Skip to content

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