Closed devserkan closed 4 months ago
@devserkan
I think that's already correct:
beacuse use memo
is a React Hook for memoizing values that lets you cache the result of a calculation between re-renders. whereas
use client
is a React directive that is commonly used or needed only if you’re using React Server Components or building a library compatible with them.
The sentence is comparing the temporary nature of use no memo
with something that is intended to be long-lived like "use client".
Thanks! Although I'm quite familiar with useMemo
and the differences between hooks and directives, I must have misunderstood something when I created this issue (or maybe I just needed more coffee). ie, they meant to clarify that there is and will not be a permanent directive like use memo
. Interestingly, I don't recall why it should link to another thing. Anyway, thanks for your comment!
Summary
The note says:
It should be
.. the same way as eg "use memo"
i guess. Also, the link goes touse client
directive reference page.Page
https://react.dev/learn/react-compiler#use-no-memo
Details
No response