Open Matthew-Man opened 2 years ago
Create a custom hook to handle the fetching, adding and deleting of posts.
Warning! Advanced.
Ensure all of the following subtasks are complete.
client
usePosts.js
{ posts, loading, error, client }
posts
loading
error
App.js
Create a custom hook to handle the fetching, adding and deleting of posts.
Warning! Advanced.
Completion Criteria
Ensure all of the following subtasks are complete.
client
directory called "hooks" and create a new fileusePosts.js
{ posts, loading, error, client }
posts
,loading
anderror
should be the existing state objects that currently live insideApp.js
client
should be an object containing the two existing functions: add and delete.