react-doctor/no-hydration-branch-on-browser-global
Server and client render different branches
- Category: Bugs
- Severity: error
- Source:
oxlint-plugin-react-doctor - Framework: global
- Enabled when: react, ssr
- Default: Enabled
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Confirm the reported code matches Server and client render different branches. Check the framework context and diagnostic message before suppressing it.
Fix prompt
Use this once validation confirms the diagnostic is real.
Render the same initial output on the server and client, then switch after mount or use useSyncExternalStore with a stable server snapshot.
Related rules
More Bugs rules from the rules reference:
react-doctor/no-impure-state-updater: State updater has side effectsreact-doctor/no-indeterminate-attribute: Indeterminate checkbox state set as an attributereact-doctor/no-initialize-state: Disallow initializing state in an effect.react-doctor/no-is-mounted: Disallow the removed legacy isMounted() API — cancel async work instead of guarding setState.react-doctor/no-jsx-element-type: Widen the return type from JSX.Element to React.ReactNode: function App(): React.ReactNode