jsx-eslint/eslint-plugin-react

prop-types: children and React.VFC

Aberta

#2.913 aberto em 1 de fev. de 2021

 (14 comentários) (3 reações) (0 responsável)JavaScript (2.731 forks)batch import
help wantedtypescript

Métricas do repositório

Stars
 (9.293 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

There is now a way to properly communicate the absence of the children prop at the TypeScript level: React.VFC (vs React.FC). React.VFC aka React.VoidFunctionComponent does not allow children prop, the prop-types rule should derive the presence/absence of children from the underlying TypeScript types (when used with TypeScript).

Related: #7.

Guia do colaborador