-
Notifications
You must be signed in to change notification settings - Fork 11
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
Tugbanur-React week 3 #25
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job overall! The fetchData function is well-written, and error handling looks good. Using setTimeout to add a delay works, but it might be better to remove it or make the loading time match the actual fetch time. The code is clean and easy to understand—well done!
setTimeout(() => { | ||
setData(result); | ||
setLoading(false); | ||
}, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good implementation overall, and the fetchData function works well. However, using setTimeout to simulate a delay might not be the best approach for production. It could be better to handle the loading state dynamically based on the actual fetch duration or remove the artificial delay altogether. What do you think?
No description provided.