Skip to content

[Beta] Remove useEvent link #5035

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

Merged
merged 6 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions beta/src/content/apis/react/useEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: useEvent
---

<Wip>

This section is incomplete, please see the RFC doc for [useEvent](https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md).

</Wip>


<Intro>

`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)

```js
useEvent(callback)
```

</Intro>

<InlineToc />
2 changes: 1 addition & 1 deletion beta/src/content/learn/separating-events-from-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ In other words, you *don't* want this line to be reactive, even though it is ins
// ...
showNotification('Connected!', theme);
// ...
````
```

You need a way to separate this non-reactive logic from the reactive Effect around it.

Expand Down
5 changes: 5 additions & 0 deletions beta/src/sidebarReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
"path": "/apis/react/useEffect",
"wip": true
},
{
"title": "useEvent",
"path": "/apis/react/useEvent",
"wip": true
},
{
"title": "useId",
"path": "/apis/react/useId",
Expand Down