Skip to content

Commit 4086a62

Browse files
committed
wip
1 parent fc8c653 commit 4086a62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/reference/react/useContext.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ function Button({ children }) {
299299
300300
</Sandpack>
301301
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) で渡しすことに注意してください。中括弧を使うことで、文字列以外のコンテクスト値も渡すことができます
303303
304304
<Solution />
305305
306-
#### コンテクストを通じてオブジェクトを更新する {/*updating-an-object-via-context*/}
306+
#### コンテクストを介してオブジェクトを更新する {/*updating-an-object-via-context*/}
307307
308308
この例では、オブジェクトを保持する `currentUser` という状態変数があります。`{ currentUser, setCurrentUser }` を 1 つのオブジェクトに組み合わせて、その中の `value={}` を介してコンテクストを下に渡します。これにより、`LoginButton` などの下位の任意のコンポーネントが `currentUser``setCurrentUser` を読み込み、必要に応じて `setCurrentUser` を呼び出すことができます。
309309

0 commit comments

Comments
 (0)