dillon1000/react
Commit
Browse files [compiler] Allow type cast expressions with refs (#31871)
We report a false positive for the combination of a ref-accessing function placed inside an array which is they type-cast. Here we teach ref validation about type casts. I also tried other variants like `return ref as const` but those already worked. Closes #31864
Changed paths3 files
First-parent comparisoncompiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoRefAccesInRender.ts ModifiedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-ref-type-cast-in-render.expect.md AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/allow-ref-type-cast-in-render.js AddedPatch
Files changed
Rendering syntax-highlighted changes…