dillon1000/react
Commit
Browse files [compiler] Handle member expr as computed property (#31344)
This PR loosens the restriction on the types of computed properties we can handle. Previously, we would disallow anything that is not an identifier because non-identifiers could be mutating. But member expressions are not mutating so we can treat them similar to identifiers.
Changed paths5 files
First-parent comparisoncompiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts ModifiedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-object-expression-member-expr-call.expect.md AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/error.todo-object-expression-member-expr-call.js AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-member.expect.md AddedA compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/object-expression-computed-member.js AddedPatch
Files changed
Rendering syntax-highlighted changes…