mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Rename experimental useEvent to useEffectEvent (#25881)
We originally had grand plans for using this Event concept for more but
now it's only meant to be used in combination with effects.
It's an Event in the FRP terms, that is triggered from an Effect.
Technically it can also be from another function that itself is
triggered from an existing side-effect but that's kind of an advanced
case.
The canonical case is an effect that triggers an event:
```js
const onHappened = useEffectEvent(() => ...);
useEffect(() => {
onHappened();
}, []);
```
This commit is contained in:
committed by
GitHub
parent
4dda96a407
commit
84a0a171ea
@@ -425,7 +425,7 @@
|
||||
"437": "the \"precedence\" prop for links to stylesheets expects to receive a string but received something of type \"%s\" instead.",
|
||||
"438": "An unsupported type was passed to use(): %s",
|
||||
"439": "We didn't expect to see a forward reference. This is a bug in the React Server.",
|
||||
"440": "A function wrapped in useEvent can't be called during rendering.",
|
||||
"440": "A function wrapped in useEffectEvent can't be called during rendering.",
|
||||
"441": "An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.",
|
||||
"442": "The current renderer does not support Resources. This error is likely caused by a bug in React. Please file an issue.",
|
||||
"443": "acquireResource encountered a resource type it did not expect: \"%s\". this is a bug in React.",
|
||||
|
||||
Reference in New Issue
Block a user