dillon1000/react
Commit
Browse files [compiler] Add tests for incorrect global mutation detection
If a function expression that mutates a global is passed as a prop, we don't throw an error as we assume it's not called in render. But if this function expression is captured in an object and passed down as prop, we throw an error. ghstack-source-id: 74cacee09f565550007b2e01fa8877ad64ccfbe9 Pull Request resolved: https://github.com/facebook/react/pull/30456
Changed paths2 files
First-parent comparisoncompiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.object-capture-global-mutation.expect.md AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.object-capture-global-mutation.js AddedPatch
Files changed
Rendering syntax-highlighted changes…