Skip to content

forwardRef example has error in TypeScript #3015

@valtism

Description

@valtism
    "@types/react": "^17.0.11",
    "@types/react-dom": "^17.0.8",
    "@typescript-eslint/eslint-plugin": "^4.28.0",
    "@typescript-eslint/parser": "^4.28.0",

The code from https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forward_and_create_ref/ on forwardRef has the error 'children' is missing in props validation based on the react/propTypes ESLint rule https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md

This rule says it validates on prop-types typing, as well as TS types. I am not sure if this is an issue in ESLint or TypeScript

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