jsx-eslint/eslint-plugin-react

prop-types: children and React.VFC

Open

#2,913 建立於 2021年2月1日

在 GitHub 查看
 (14 留言) (3 反應) (0 負責人)JavaScript (8,630 star) (2,797 fork)batch import
help wantedtypescript

描述

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.

貢獻者指南

prop-types: children and React.VFC · jsx-eslint/eslint-plugin-react#2913 | Good First Issue