File tree 1 file changed +2
-2
lines changed
src/content/reference/react
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -299,11 +299,11 @@ function Button({ children }) {
299
299
300
300
</Sandpack>
301
301
302
- ` value= " dark" は " dark" ` という文字列を渡しますが、` value= {theme}` は JavaScript の ` theme` 変数の値を [JSX curly braces. ](/learn/javascript-in-jsx-with-curly-braces) で渡します。波括弧を使うと、文字列でないコンテクスト値も渡すことができます 。
302
+ ` value= " dark" ` は ` " dark" ` という文字列を渡しますが、` value= {theme}` は JavaScript の ` theme` 変数の値を [JSX の中括弧 ](/learn/javascript-in-jsx-with-curly-braces) で渡しすことに注意してください。中括弧を使うことで、文字列以外のコンテクスト値も渡すことができます 。
303
303
304
304
<Solution />
305
305
306
- #### コンテクストを通じてオブジェクトを更新する {/*updating-an-object-via-context*/}
306
+ #### コンテクストを介してオブジェクトを更新する {/*updating-an-object-via-context*/}
307
307
308
308
この例では、オブジェクトを保持する ` currentUser` という状態変数があります。` { currentUser, setCurrentUser }` を 1 つのオブジェクトに組み合わせて、その中の ` value= {}` を介してコンテクストを下に渡します。これにより、` LoginButton` などの下位の任意のコンポーネントが ` currentUser` と ` setCurrentUser` を読み込み、必要に応じて ` setCurrentUser` を呼び出すことができます。
309
309
You can’t perform that action at this time.
0 commit comments