Skip to content

fix: regression in no-unstable-context-value in 1.29.0 #964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Mar 3, 2025

No actual fix, but a repro demonstrating the issue.

{
    ruleId: '@rule-tester/no-unstable-context-value',
    severity: 2,
    message: "A/an 'arrow function expression' passed as the value prop to the context provider should not be constructed. It will change on every render. Consider wrapping it in a useCallback hook.",
    line: 2,
    column: 24,
    nodeType: 'ArrowFunctionExpression',
    messageId: 'unstableContextValue',
    endLine: 4,
    endColumn: 8
  }

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

```
{
    ruleId: '@rule-tester/no-unstable-context-value',
    severity: 2,
    message: "A/an 'arrow function expression' passed as the value prop to the context provider should not be constructed. It will change on every render. Consider wrapping it in a useCallback hook.",
    line: 2,
    column: 24,
    nodeType: 'ArrowFunctionExpression',
    messageId: 'unstableContextValue',
    endLine: 4,
    endColumn: 8
  }
```
Copy link

vercel bot commented Mar 3, 2025

@mrginglymus is attempting to deploy a commit to the Rel1cx's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mrginglymus
Copy link
Contributor Author

Looking at the blame, seems like not a regression in no-unstable-context-value, but an existing bug now exposed by better heuristics for identifying context providers.

@Rel1cx Rel1cx merged commit 1df5702 into Rel1cx:main Mar 3, 2025
7 of 10 checks passed
@mrginglymus mrginglymus deleted the fp-context-arrow branch March 3, 2025 14:12
@mrginglymus
Copy link
Contributor Author

Thanks for the quick fix @Rel1cx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants