Skip to content

maxim2310/react_dynamic-list-of-todos

 
 

Repository files navigation

React dynamic list of TODOs

Description

You are given a basic markup for the App, TodosList and CurrentUser components and the API.

Add the data loading, so the App works as described below:

  1. Create a separate file api.ts to put all the API call there.
  2. Todos are fetched on page load from GET todos endpoint. (useEffect(() => { ... }, []))
  3. Each todo has a button to select a user but selectedUserId is stored in the App. (pass a callback to the TodoList)
  4. CurrentUser component receives userId as a prop and loads user details from GET user endpoint (replace 1 with a given userId).
  5. If I select another user the details should be updated. (useEffect(() => { ... }, [userId])).
  6. If I select the same user there should not be a request to the server.
  7. Add a button Clear into the CurrentUser to clear the selectedUser in the App
  8. Add an <input> to the TodoList to filter the todos by title
  9. Add a <select> to the TodoList to show all, active(not completed) or completed todos.
  10. (*) Add Randomize button to the TodoList to show the todos in a random order.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SCSS 44.9%
  • TypeScript 40.2%
  • JavaScript 8.7%
  • HTML 6.2%