jsx-eslint/eslint-plugin-react

prop-types: children and React.VFC

Open

#2913 aperta il 1 feb 2021

Vedi su GitHub
 (14 commenti) (3 reazioni) (0 assegnatari)JavaScript (2797 fork)batch import
help wantedtypescript

Metriche repository

Star
 (8630 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor