f707ecd7b33083970af0a396ea2e1283564a8602
Next.js 13+ App Router calls hydrateRoot on <html> or <body> directly
(not on a #__next div), so __reactFiber$ annotations land on
document.documentElement or document.body.
Changes:
- Add document.documentElement to the candidate list (covers App Router)
- Extract getFiber() helper to remove repeated key-scan loop
- Add DOM-wide fallback scan (querySelectorAll('*')) so any React app
is found regardless of its root container convention
- Remove the early !tree bail-out — post FIBER_TREE_UPDATE even with a
sparse tree, matching onCommitFiberRoot's behaviour
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Languages
TypeScript
82.8%
PHP
10.2%
CSS
6.2%
HTML
0.4%
Shell
0.4%