Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-week2 assignment #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sanazzarei
Copy link

No description provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the assignment rules - I believe the fake data directory should no longer be here?

return response.json();
})
.then((data) => {
setLoading(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the loading set to true anywhere?

<div className="app">
<Header category={category} setCategory={setCategory} />
{loading ? (
<div>Loading...</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this will show, due to my comment above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the loading message ("Loading...") will be displayed when the loading state is true. The loading state is initially set to true, and it's only set to false after the successful completion of the API call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants