scrimba
Meta scrims
React Advanced
Lab Solution: Can you fetch data?
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Lab Solution: Can you fetch data?
AboutCommentsNotes
Lab Solution: Can you fetch data?
Expand for more info
src
App.js
run
preview
console
import React from "react";

function App() {
const [user, setUser] = React.useState([]);

const fetchData = () => {

};

React.useEffect(() => {
fetchData();
}, []);

return Object.keys(user).length > 0 ? (
<div style={{padding: "0 20px"}}>
<h1>Customer data</h1>

</div>
) : (
<h1>Data pending...</h1>
);
}

export default App;
Console
/public/index.html
-3:21