Menu
×
×
Correct!
Exercise:What do you need to add to the second argument of a
import { useState, useEffect } from "react";
import ReactDOM from "react-dom/client";
function App() {
const [data, setData] = useState([]);
useEffect(() => {
setData(getData())
}, @(2));
return <DisplayData data={data} />;
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
import { useState, useEffect } from "react";
import ReactDOM from "react-dom/client";
function App() {
const [data, setData] = useState([]);
useEffect(() => {
setData(getData())
}, []);
return <DisplayData data={data} />;
}
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 24 exercises.
Are you sure you want to continue?