Click in order · JavaScript and React course · Module 10: React Ecosystem and Future
useQuery State Handling
Click the elements in the order from the lesson: the useQuery call, handling loading, handling the error and displaying the data:
Items to click
- const { data, loading, error } = useQuery(QUERY);
- return <DataList data={data} />;
- if (loading) return <Spinner />;
- if (error) return <ErrorMessage />;
You can check the correct answer by solving this task in the CodeWorlds game.