Skip to content

Commit 25171aa

Browse files
zqrangaearon
andauthored
[Beta] Remove useEvent link (#5035)
* [Beta] Remove `useEvent` link * [Beta] Add `useEvent` stub page * [Beta] Update `useEvent` description * Update useEvent.md * Alphabetical Co-authored-by: dan <dan.abramov@gmail.com>
1 parent acc8dcf commit 25171aa

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: useEvent
3+
---
4+
5+
<Wip>
6+
7+
This section is incomplete, please see the RFC doc for [useEvent](https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md).
8+
9+
</Wip>
10+
11+
12+
<Intro>
13+
14+
`useEvent` is a React Hook that lets you extract non-reactive Effect logic into an [Event function.](/learn/separating-events-from-effects#declaring-an-event-function)
15+
16+
```js
17+
useEvent(callback)
18+
```
19+
20+
</Intro>
21+
22+
<InlineToc />

beta/src/content/learn/separating-events-from-effects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ In other words, you *don't* want this line to be reactive, even though it is ins
394394
// ...
395395
showNotification('Connected!', theme);
396396
// ...
397-
````
397+
```
398398
399399
You need a way to separate this non-reactive logic from the reactive Effect around it.
400400

beta/src/sidebarReference.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@
113113
"path": "/apis/react/useEffect",
114114
"wip": true
115115
},
116+
{
117+
"title": "useEvent",
118+
"path": "/apis/react/useEvent",
119+
"wip": true
120+
},
116121
{
117122
"title": "useId",
118123
"path": "/apis/react/useId",

0 commit comments

Comments
 (0)