Responsive App w/ React, React Router, and CSS Modules

Solution retrospective
Hello everyone! This was an awesome challenge.
I ran into an issue using React Router. For each job posting, there is a route that takes you to the URL "/job/:id", which works great. So, if you click on the job with the ID of 2, it will route to .../job/2. However, the issue comes into play when you refresh the page.
Since App.js does not load upon refreshing the /jobs/:id page, the JSON data does not get passed down to the page, so the page does not render. I have tried many times to resolve this issue, and I think the best solution would be to having an actual API. In such a case, I would be able to request the job data each time the job details page loads using the useParams hook.
Any thoughts on this issue and/or my potential solution proposal? Thanks.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Thomas Kressman's solution.
Join 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