import React from 'react';
import Form from './components/Form';
import Online from './components/Online';
function App() {
const state = {
a: undefined,
}
const getApi = async (e) =>{
e.preventDefault();
const api = await fetch('https://api.wrimororld.com/online');
const data = await api.json();
console.log(data);
state.setState = {
a: data.potato,
}
}
return (
<div className="App">
<Form MethodGetOnline={getApi}/>
<Online total={getApi.state.a}/> /*Не работает эта строка*/
</div>
);
}
export default App;
Буду благодарен за помощь!