Bread
Bread
Explore posts from servers
NNuxt
Created by Bread on 5/9/2024 in #❓・help
Hydration mismatch / flashing when altering phone number
I'm trying to get a phone number to change using a package called "InfinityTracking". The nuts and bolts of what the issue is, we have a SSR component (or to be specific just a phone number) that is SSR. When the page is loaded, the phone number is returned from the server, it is then overridden client-side by this external library (injected by GTM), then client-side hydration happens and it returns back to the server-rendered value and then the package changes it back. As a pseudo shorthand, its: 123 -> 456 -> 123 -> 456 and the desired behaviour is: 123 -> 456 The package is non-negotiable. I've tried 'wrapping' the phone number in a component that is <client-only> but that obviously prevents the 'initial' value from the Server being rendered.
2 replies
NNuxt
Created by Bread on 3/18/2024 in #❓・help
Prevent routing to a redirection
I have a product page /holidays/grand-canyon and when hitting a CTA (nuxt-link) the user is sent to an interstitional route provided by an API /basket?holidayCode=1234 this then redirects to the correct 'step' in the journey to purchase, ie. /basket/extras if the holiday has any extras available for purchase. When on this first page in the purchase journey, if you hit the back button in the browser you are taken to the redirection step (/basket?holidayCode=1234) which then puts you right back where you started. How can I prevent this? pseduo diag: Desired: PDP ⇨ Book ⇨ Basket Step [back]⇨ PDP Actual: PDP ⇨ Book ⇨ Basket Step [back]⇨ Book ⇨ Basket Step
3 replies