Answer the question
In order to leave comments, you need to log in
Why does it say that the hook is not in a functional component?
Here is the component
import React, {useState, useEffect, Fragment} from 'react';
const [OperationsList, setOperationsList] = useState([]);
import {apiGetOperationsLoan} from '../api/Api';
import TabBar from './TabBar.jsx';
import TabBarItem from './TabBarItem.jsx';
export default function App() {
useEffect(() => {
apiGetOperationsLoan()
.then((response) => {
setOperationsList(response.data);
});
})
return (
<Fragment>
<div className="cabinet__history-title">
<h1>
История операций
</h1>
</div>
<TabBar>
<TabBarItem label="Операции ">
</TabBarItem>
<TabBarItem label="Финансовые ">
<p>2</p>
</TabBarItem>
<TabBarItem label="Системные ">
<p>3</p>
</TabBarItem>
<TabBarItem label="Кредитный ">
<p>4</p>
</TabBarItem>
</TabBar>
</Fragment>
);
}
/* eslint-enable */
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question