-
Hello every one, i'm using DynamicLinksFunction to add styles depending on the loaded data. When I tested, I could see my styles are correctly loaded for the first page only, and then when I navigate to different pages of the website, the new required styles are not loaded. So I added some console.log("") and breakpoints to see what happens. Part of my code for the page : ** Loader : ** export const loader: LoaderFunction = async ({ request }) => { ** Dynamic Links : **
** Meta for SEO (title, description of page) : **
When i open my browser and navigate to a page, let's say : I can see this log :
Then from the menu of the website, I click to a link to go to another page, let's say : And I can notice that some styles are not present and some div doesn't render as they should, since the style is missing. In the log :
I can see only the loader function is called. Of course, my breakpoint in the dynamiclink function has never been called. If I refresh the page from the browser, it's called and the style is loaded. Did I miss something ? Thank you very much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Finally I could found out what happened, so please don't try to help me anymore about it :). For people who whould be in the same situation : The Meta and dynamics links functions are call client side after hydratation is done, that's why I couldn't see the log server side, it was logged on client side. My styles were not loaded after the first page, because the DynamicLinks function was accessing a file that ends with ".server.ts" so it was not available for the client. I renamed it with ".ts" instead of ".server.ts" and it's working. |
Beta Was this translation helpful? Give feedback.
Finally I could found out what happened, so please don't try to help me anymore about it :).
For people who whould be in the same situation :
The Meta and dynamics links functions are call client side after hydratation is done, that's why I couldn't see the log server side, it was logged on client side.
My styles were not loaded after the first page, because the DynamicLinks function was accessing a file that ends with ".server.ts" so it was not available for the client. I renamed it with ".ts" instead of ".server.ts" and it's working.