Hi folks,
After using React for 6 years, I cannot count how many times I've seen the "window is not defined" error and its partner in crime, the "hydration mismatch error".
The introduction of React Server Components has been a great occasion to better explain the root cause of these issues by introducing React Browser Components.
The article describes this new concepts and ends with a list of multiple solutions to fix window not defined/hydration errors, with the appropriate situation where they apply.
1 comment
[ 28.2 ms ] story [ 512 ms ] thread