Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo]: Wrong directive name in use no memo note #6923

Closed
devserkan opened this issue May 30, 2024 · 2 comments
Closed

[Typo]: Wrong directive name in use no memo note #6923

devserkan opened this issue May 30, 2024 · 2 comments

Comments

@devserkan
Copy link

Summary

The note says:

"use no memo" is a temporary escape hatch that lets you opt-out components and hooks from being compiled by the React Compiler. This directive is not meant to be long lived the same way as eg "use client" is.

It should be .. the same way as eg "use memo" i guess. Also, the link goes to use client directive reference page.

Page

https://react.dev/learn/react-compiler#use-no-memo

Details

No response

@CuriousCoder00
Copy link

CuriousCoder00 commented Jul 11, 2024

@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".

@devserkan
Copy link
Author

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!

@devserkan devserkan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants