Skip to content

Commit 40e2617

Browse files
committed
add a note about react compiler
1 parent 19c5990 commit 40e2617

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/guide/extras/composition-api-faq.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ React Hooks are invoked repeatedly every time a component updates. This creates
146146

147147
- The stale closure problem, combined with Concurrent features, makes it difficult to reason about when a piece of hooks code is run, and makes working with mutable state that should persist across renders (via `useRef`) cumbersome.
148148

149+
> Note: some of the above issues that are related to memoization can be resolved by the upcoming [React Compiler](https://react.dev/learn/react-compiler).
150+
149151
In comparison, Vue Composition API:
150152

151153
- Invokes `setup()` or `<script setup>` code only once. This makes the code align better with the intuitions of idiomatic JavaScript usage as there are no stale closures to worry about. Composition API calls are also not sensitive to call order and can be conditional.

0 commit comments

Comments
 (0)