@elaineleung
Posted
Hi Bao Dang, great job building this with React, and I like your slowly spinning dice!
I'm using Firefox, and I see that there's a caching issue here that's common for these solutions, where on Firefox, the next advice could not be loaded due to caching. If you have Firefox, you can try it out too. What you need to do is to add a header object for fetch, like this:
fetch("https://api.adviceslip.com/advice", { cache: 'no-cache' })
Since this is a React app, you might need more configurations for GitHub and could get complicated (GH Pages is designed for static pages only and I think static site generators also work). I also use GH Pages usually, but for React I would deploy my repo using Vercel instead.
Great job once again, wish I got to see the advice working though!
Marked as helpful
@weebao
Posted
@elaineleung Thank you so much for your advice! Sorry for replying late, but I fixed it as you said and it worked wonders! I am creating another react app right now, so I will also try to use Vercel. Have a good day!
@elaineleung
Posted
@weebao Glad to help! I just checked it out again and it's working well 😊
@weebao
Posted
@elaineleung Thank you so much!