DEV Community

Vivek Sharma
Vivek Sharma

Posted on

How to Fix "Styles and JS Not Loading on Page Reload" in React When Using useParams()

I using React with React Router and have a route like http://localhost:3000/category-wise/6, you might encounter a problem where, on a page reload, only the HTML data is shown and all styles and JavaScript files fail to load. This issue often happens when you're using the useParams() hook to get URL parameters in your component.

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series 📺

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series 👀

Watch the Youtube series