Content-Length: 281845 | pFad | https://github.com/jsx-eslint/eslint-plugin-react/issues/2309

CA [react/destructuring-assignment] Shows weird behaviour when I declare a variable with the name context · Issue #2309 · jsx-eslint/eslint-plugin-react · GitHub
Skip to content

[react/destructuring-assignment] Shows weird behaviour when I declare a variable with the name context #2309

Closed
@roman-16

Description

@roman-16

In a functional component I get an error when I declare a variable with the name context.
Example code:

const Test = props => {
  const context = useContext(someContext);

  return (
    <div {...props}>
      {context.test} // Here message: 'Must use destructuring context'
    </div>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/jsx-eslint/eslint-plugin-react/issues/2309

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy