[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: 8d0655aac992b09d327a60123b7e96ea1d678d80 Pull Request resolved: https://github.com/facebook/react/pull/30456
Showing
- compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.object-capture-global-mutation.expect.md 33 additions, 0 deletions...s/compiler/error.object-capture-global-mutation.expect.md
- compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.object-capture-global-mutation.js 12 additions, 0 deletions...fixtures/compiler/error.object-capture-global-mutation.js
Please register or sign in to comment