-
Hi I want to add HydrationBoundary into root layout to have a single QueryClient but I have two root layouts: If I implement HydrationBoundary for each on I would have two QueryClient, right? so if I mutate one of them, the other one won't change and I'll lose consistency between the app states (the app is an online shop and I'm dealing with orders, cart, etc.). How can I achieve this? Thanks again |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
can you create a unified root layout above the two layouts and do it there? |
Beta Was this translation helpful? Give feedback.
Yes, it works. Thank you @TkDodo
I changed the the app structure:
layout.js
-- (products)
---- layout.js
---- ...
-- (rest-routes)
---- layout.js
---- ...
But adding page.js didn't work (page.js in root has conflict with page.js under (rest-routes)):
layout.js
page.js ❌
-- (products)
---- /products
------ layout.js
------ page.js
---- layout.js
---- ...
-- (rest-routes)
---- layout.js
---- page.js ❌
---- ...