jsx-eslint/eslint-plugin-react

prop-types: children and React.VFC

Open

#2.913 geöffnet am 1. Feb. 2021

Auf GitHub ansehen
 (14 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)JavaScript (2.797 Forks)batch import
help wantedtypescript

Repository-Metriken

Stars
 (8.630 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide