Gatsby dynamic routing flash of a page before content loads #26911
-
Hello, My company is trying to achieve the following with the gatsby project.
This is our component
Here is how we are building the client-side routes
Here is a problem we have But is there a way to prevent that flash, because |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I'm having a similar issue. I'm creating the page the same way as you and the website flashs my index.js page before loading the correct one. I'm not using the router since I have the same behavior creating the pages separately. Probably if you try separating the logic into two separate pages and without the router you will still have the issue since it happens to me to. http://site2.simplicode.com.br/aula/p2p gatsby-node.js
pages/aula.js
pages/index.js
|
Beta Was this translation helpful? Give feedback.
-
Thanks @matrpedreira This is probably going to fail on a windows because it doesn't allow directory names with
|
Beta Was this translation helpful? Give feedback.
-
Changing to use the code on gatsby-node.js exactly like yours keeps the same behavior.
|
Beta Was this translation helpful? Give feedback.
-
I found this solution on another issue. It fixes the problem. |
Beta Was this translation helpful? Give feedback.
I found this solution on another issue. It fixes the problem.
#5329 (comment)