You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Server Hybrid (Server + Client Rendering) scheme for next.js, we get warning when navigating.
The error occurs because of using the useGrowthBookSSR hook.
Click the Server Hybrid (Server + Client Rendering) link on the home page (/server-hybrid).
On the first transition we will see the warning, on subsequent transitions it will not be there.
bug-1.mov
Expected Behavior
Navigation does not create a warning.
Current Behavior
Using the Server Hybrid scheme (Server + Client Rendering), we get a navigation error.
server-hybrid.tsx:26 Warning: Cannot update a component (`GrowthBookProvider`) while rendering a different component (`ServerHybridPage`). To locate the bad setState() call inside `ServerHybridPage`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
at ServerHybridPage (webpack-internal:///./pages/server-hybrid.tsx:16:11)
The text was updated successfully, but these errors were encountered:
@MaksimLavrenyuk We recently updated our next.js example in our growthbook/examples repo. This problem was addressed in our hybrid implementation. Mind taking a look and letting us know if it helps?
Summary
When using the Server Hybrid (Server + Client Rendering) scheme for next.js, we get warning when navigating.
The error occurs because of using the useGrowthBookSSR hook.
You can repeat with an example from the repository: https://github.com/growthbook/examples/tree/main/next-js
Click the Server Hybrid (Server + Client Rendering) link on the home page (/server-hybrid).
On the first transition we will see the warning, on subsequent transitions it will not be there.
bug-1.mov
Expected Behavior
Navigation does not create a warning.
Current Behavior
Using the Server Hybrid scheme (Server + Client Rendering), we get a navigation error.
The text was updated successfully, but these errors were encountered: