Skip to content

Commit bf10489

Browse files
docs: add note about use(Context) support in React 19 to useContext reference
Informs developers that starting in React 19, use(Context) can be used instead of useContext(Context) to read context inside conditionals and loops.
1 parent 7c36f7a commit bf10489

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/content/reference/react/useContext.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ const value = useContext(SomeContext)
1212

1313
</Intro>
1414

15+
<Note>
16+
17+
Starting in React 19, you can use [`use(Context)`](/reference/react/use) instead of `useContext(Context)`, which allows you to read context in conditionals and loops.
18+
19+
</Note>
20+
1521
<InlineToc />
1622

1723
---

0 commit comments

Comments
 (0)