PropTypes
React
の
Props
に
types 型定義
を与える
TypeScript
使わないけど、
Props
に型与えたい時に使う
もともと
React
v15.5までは、
React
内に存在したが分けられた
TypeScript
使うようになったからっぽい
production mode
で含まれない、実行されない
facebook/prop-types: Runtime type checking for React props and similar objects
children react
の型
jsx - ReactJs: What should the PropTypes be for this.props.children? - Stack Overflow
children: PropTypes.node.isRequired,
参考
React入門 ~PropTypes編~