Click in order · JavaScript and React course · Module 5: useEffect and Custom Hooks
Async Operations in useEffect
Arrange async operations in useEffect:
Items to click
- async function fetchData() {
- fetchData();
- setData(await response.json());
- useEffect(() => {
- }, []);
- const response = await fetch('/api/data');
You can check the correct answer by solving this task in the CodeWorlds game.