props.children の使い方が理解できないです。
const User = () =>{ ・ ・ ・ return ( <Test>ユーザー</Test> ) } const Test = (props) =>{ return (<h1>{props.children}</h1>) } Test.propTypes ={ children:PropTypes.string }
とコードがあります。
この
props.children
のchildrenの役割が理解できないです。
なぜchildrenが必要なのでしょうか?
propsだけではダメなのでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。