Trouble with Dynamic Routing and CSS Delay #11933
Unanswered
sambhav2612
asked this question in
Help
Replies: 1 comment 1 reply
-
You'll want to use built-in CSS support which ensures css is loaded before navigating: https://nextjs.org/docs/basic-features/built-in-css-support |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We recently upgraded our code from Next 7.0.2 to 9.3.5 and we are facing some trouble in regard to those mentioned in the title of this post.
1. Dynamic Routing
We currently use next-routes to handle routing across the app. Given, the last time it was updated was 2 years back, it still works fine but causes the app to reload in production and development when navigating to a dynamic route from either static or dynamic route.
Since, it is not being maintained at all and still uses Next 6.0.0, it'd move in favor of using next/link instead of this from now on, however, to do that I saw from #10736 that for dynamic routing to work those dynamic parameters have to be placed in the child tree of the parent component. For example, our current routing file looks like this:
So, to work with next-link from now on, I'd have to place a new id component under the category component, is that it, am I following the documentation right?
2. CSS Delay
Coming to another issue I mentioned, we are facing some serious CSS delay in our app, for instance, I'll attach a screencast of the issue:
This is in production build and what I observed is that it doesn't necessarily load the CSS per se, whilst so it just shows the barebones of the page and once you hover over some element (as you see, I hovered over the logo image where it should be rightly placed), it all just comes back to life.
A point to note here might be that we also use a webpack loader to load all SASS variables from a
variable.scss
file sitting at the base of the tree. Here's what our next.config.js looks like:It'd be a great help if the team or community can assist with any of the problems I mentioned here.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions