GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [compiler] Allow all hooks to take callbacks which access refs, but ban hooks from taking direct ref value arguments by mvitousek · Pull Request #30917 · react/react Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…an hooks from taking direct ref value arguments Summary: This brings the behavior of ref mutation within hook callbacks into alignment with the behavior of global mutations--that is, we allow all hooks to take callbacks that may mutate a ref. This is potentially unsafe if the hook eagerly calls its callback, but the alternative is excessively limiting (and inconsistent with other enforcement). This also bans *directly* passing a ref.current value to a hook, which was previously allowed. ghstack-source-id: 1102435 Pull Request resolved: #30917
| returnValueKind: ValueKind.Mutable, | ||
| }), | ||
| ], | ||
| [ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is left over from a previous version of this work, but seems reasonable to add anyways
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| ### Eval output | ||
| (kind: exception) useRef is not defined No newline at end of file |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
oops
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
awesome
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…refs, but ban hooks from taking direct ref value arguments" Summary: This brings the behavior of ref mutation within hook callbacks into alignment with the behavior of global mutations--that is, we allow all hooks to take callbacks that may mutate a ref. This is potentially unsafe if the hook eagerly calls its callback, but the alternative is excessively limiting (and inconsistent with other enforcement). This also bans *directly* passing a ref.current value to a hook, which was previously allowed. [ghstack-poisoned]
…an hooks from taking direct ref value arguments Summary: This brings the behavior of ref mutation within hook callbacks into alignment with the behavior of global mutations--that is, we allow all hooks to take callbacks that may mutate a ref. This is potentially unsafe if the hook eagerly calls its callback, but the alternative is excessively limiting (and inconsistent with other enforcement). This also bans *directly* passing a ref.current value to a hook, which was previously allowed. ghstack-source-id: e66ce71 Pull Request resolved: #30917
…an hooks from taking direct ref value arguments Summary: This brings the behavior of ref mutation within hook callbacks into alignment with the behavior of global mutations--that is, we allow all hooks to take callbacks that may mutate a ref. This is potentially unsafe if the hook eagerly calls its callback, but the alternative is excessively limiting (and inconsistent with other enforcement). This also bans *directly* passing a ref.current value to a hook, which was previously allowed. ghstack-source-id: e66ce71 Pull Request resolved: #30917 DiffTrain build for [e78c936](e78c936)
**breaking change for canary users: Bumps peer dependency of React from `19.0.0-rc-206df66e-20240912` to `19.0.0-rc-a99d8e8d-20240916`** [diff react/react@206df66e...a99d8e8d](react/react@206df66...a99d8e8) <details> <summary>React upstream changes</summary> - react/react#30977 - react/react#30971 - react/react#30922 - react/react#30917 - react/react#30902 - react/react#30912 - react/react#30970 - react/react#30969 - react/react#30967 - react/react#30966 - react/react#30960 - react/react#30968 - react/react#30961 - react/react#28255 - react/react#30957 - react/react#30958 - react/react#30959 - react/react#30951 - react/react#30954 - react/react#30920 - react/react#30942 </details>
…an hooks from taking direct ref value arguments Summary: This brings the behavior of ref mutation within hook callbacks into alignment with the behavior of global mutations--that is, we allow all hooks to take callbacks that may mutate a ref. This is potentially unsafe if the hook eagerly calls its callback, but the alternative is excessively limiting (and inconsistent with other enforcement). This also bans *directly* passing a ref.current value to a hook, which was previously allowed. ghstack-source-id: e66ce71 Pull Request resolved: react#30917
a53a513b
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.