RE02 Exercises
Practical Exercises
- Write a TodoItem component (with a prop:
{id: number}), that fetches one todo item fromhttps://jsonplaceholder.typicode.com/todos/<id>(with the id being the property passed to this component) and displays this todo.
The type of the returned todo on this url is:
type Todo = {
id: number;
userId: number;
title: string;
completed: boolean
}- Name a few common wrong use cases of the useEffect hook.