What's Changed
🐞 Fixes
- Fixed false negatives in the JSX element resolver used by the
react-domrules: polymorphic components written as member expressions (e.g.<motion.div as="button">) were mistaken for host elements, so the polymorphic prop was ignored and these rules skipped them entirely; they are now resolved through the polymorphic prop and checked like the underlying DOM element. String values of the polymorphic prop are also normalized to lowercase, soas="BUTTON"is treated asbutton. Affected rules:react-dom/no-missing-button-typereact-dom/no-missing-iframe-sandboxreact-dom/no-unsafe-iframe-sandboxreact-dom/no-unsafe-target-blankreact-dom/no-void-elements-with-children
🏗️ Internal
- The normalized
polymorphicPropNamesetting type is corrected fromstring | nulltostring— it could never benullat runtime — and the unreachablenullbranch in the JSX element resolver used by thereact-domrules is removed.
Full Changelog: v5.20.1...v5.20.2
Attestation
https://github.com/Rel1cx/eslint-react/attestations/48764635