jsx-eslint/eslint-plugin-react

prop-types: children and React.VFC

Ouverte

#2 913 ouverte le 1 févr. 2021

 (14 commentaires) (3 réactions) (0 personne assignée)JavaScript (2 731 forks)batch import
help wantedtypescript

Métriques du dépôt

Stars
 (9 293 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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.

Guide contributeur