diff --git a/compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts b/compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts index 70c57c908a..79ebcb449c 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts @@ -1506,6 +1506,6 @@ function getWriteErrorReason(abstractValue: AbstractValue): string { } else if (abstractValue.reason.has(ValueReason.ReactiveFunctionArgument)) { return "Mutating props or hook arguments is not allowed. Consider using a local variable instead."; } else { - return "This mutates a global or a variable after it was passed to React, which means that React cannot observe changes to it."; + return "This mutates a variable that React considers immutable."; } } diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.mutate-function-property.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.mutate-function-property.expect.md index 863bf529ea..11de342493 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.mutate-function-property.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.mutate-function-property.expect.md @@ -15,7 +15,7 @@ export function ViewModeSelector(props) { ## Error ``` -[ReactForget] InvalidReact: This mutates a global or a variable after it was passed to React, which means that React cannot observe changes to it. (3:3) +[ReactForget] InvalidReact: This mutates a variable that React considers immutable. (3:3) ``` \ No newline at end of file