Design comparison
Solution retrospective
Built this project to practice with React and fetching data from an API. Happy with how it turned out :)
Community feedback
- @Sdann26Posted over 2 years ago
Hi Cody!
I don't know if my comment can help you but what happens is that when I run your code in Mozilla Firefox when I hit the button it doesn't generate a new phrase.
What I could recommend is that the fetch method to obtain data, it receives 2 parameters, you have placed 1 which is the "url" you can give another that are optional parameters.
For example:
fetch('https://api.adviceslip.com/advice', {cache: 'no-cache'})
.With this you make that it is not saved in the cache.
I would also recommend that the effect of the button is a little faster but it is personal taste.
For everything else it looks pretty good, I don't see any flaws.
Good Coding!
Marked as helpful1@CodyJPerryPosted over 2 years ago@Sdann26 Thanks for the reply!
That's an awesome suggestion! I thought since the API cached it itself 2 seconds for each request I could not get around that. Once I added it and tested its even better.
I also love the suggestion about the transition effect. Now that you mention it that does feel a little long so reduced that transition by 0.5s.
Thanks for taking the time to give some feedback. It's much appreciated! :)
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord