What's Changed
✨ New
react-x/refsnow detects nested property writes on a ref's value (e.g.ref.current.inner = value), which are now reported aswriteDuringRenderinstead of being misclassified as a read.react-x/refsnow tracks functions bound to (and called through) simple object-member-expression targets (e.g.object.foo = () => ref.current; object.foo();), closing a gap in the render-reachability analysis that previously only covered plain variable bindings.react-x/refsnow detectsref.currentaccesses inside the lazy initializer function passed directly asuseState's first argument, since it runs synchronously during the initial render unlike other hook-callback arguments.react-x/refsnow exempts calls to a function namedrender(e.g.props.render(ref), a common render-prop pattern) from therefPassedToFunctiondiagnostic, alongside the existingmergeRefs/hook exemptions.
🐞 Fixes
- Improved
react-x/refslazy-init guard-block detection so it is direction-aware: inside the branch of anif (ref.current == null)-style guard that is guaranteed to seeref.currentas null, only a direct write is treated as the (single) valid initialization; reads or values passed to a function there are still reported.
🏗️ Internal
- Refactored
react-x/refsinternals, replacingisRefCurrentNullCheckwithgetRefCurrentNullCheckBranchinlib.ts. - Upgraded
fumadocspackages andpreact. - Cleaned up redundant code in the
react-debug/jsxrule.
Full Changelog: v5.12.2...v5.13.0
Attestation
https://github.com/Rel1cx/eslint-react/attestations/34507143