-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
"Rules of React" docs would cause TypeError #6903
Comments
is it still valid... can i work on this? |
There's already a PR for this #6905 |
Okay... Thanks for letting me know
…On Mon, 27 May 2024, 12:38 pm Reko Jokelainen, ***@***.***> wrote:
is it still valid... can i work on this?
There's already a PR for this #6905
<#6905>
—
Reply to this email directly, view it on GitHub
<#6903 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APYOQHKRBI6GNKSCQ7ZHI2DZEMLNFAVCNFSM6AAAAABIE5LWFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTGI4TGMZVHA>
.
You are receiving this because you commented.Message ID: <reactjs/react.
***@***.***>
|
If this issue was solved then close this issue. |
The PR was not merged by the core team, so will rather keep this open. It should be automatically closed when the pull request is. |
Can you tell me what the actual issue in this code? because I show there is no issue. ( Tell me how you get this issue. ) I found that code on the page and this code is written for the what kind of mistake cannot do in react state (Don’t mutate State |
const [foo, bar] = [1, 2];
foo = foo + 1;
// Uncaught TypeError: Assignment to constant variable. |
const Counter =()=> { const handleClick =()=> setCount((prev)=>prev+1) } |
The example here would cause a
TypeError: Assignment to constant variable.
react.dev/src/content/reference/rules/components-and-hooks-must-be-pure.md
Lines 236 to 241 in f055f8f
The text was updated successfully, but these errors were encountered: