dillon1000/react
Commit
Browse files Make Other mutation validation message more generic
The current error message "This mutates a global or a variable after it was passed to React" no longer makes sense since we now have more specific error messages for different kinds of Effect.Mutate or Effect.Stores. This replaces the fallthrough "Other" case with a more generic message. It's not perfect, but it's a little more accurate than what is currently emitted The proper fix might be to treat functions as mutable objects and allow the mutation, or special case `Function.displayName`. For now though this PR just updates the message in the meantime so it's less confusing.
Changed paths2 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.mutate-function-property.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…