File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ function WelcomeDialog() {
50
50
` <FancyBorder> ` JSX タグの内側のあらゆる要素は ` FancyBorder ` に ` children ` という props として渡されます。 ` FancyBorder ` は ` <div> ` の内側に ` {props.children} ` をレンダリングするので、渡された要素が出力されます。
51
51
52
52
あまり一般的ではありませんが、複数の箇所に子要素を追加したいケースも考えられます。そのようなケースでは以下のように ` children ` の props の代わりに独自の props を作成して渡すことができます。
53
- この実装方法は他のライブラリで言うところの slot や yield のような考え方ですが、React のコンポーネントに props として渡せるものに制限はありません。
54
53
55
54
``` js{5,8,18,21}
56
55
function SplitPane(props) {
@@ -81,7 +80,8 @@ function App() {
81
80
82
81
[ ** Try it on CodePen** ] ( https://codepen.io/gaearon/pen/gwZOJp?editors=0010 )
83
82
84
- ` <Contacts /> ` や ` <Chat /> ` のような React の要素はただのオブジェクトなので、他のあらゆるデータと同様に props として渡すことができます。
83
+ ` <Contacts /> ` や ` <Chat /> ` のような React の要素はただのオブジェクトなので、他のあらゆるデータと同様に props として渡すことができます。このアプローチは他のライブラリで言うところの slot に似ていると感じるかもしれませんが、React のコンポーネントに props として渡せるものに制限はありません。
84
+
85
85
86
86
## 特化したコンポーネント (Specialization)
87
87
You can’t perform that action at this time.
0 commit comments