Browse Source

[Beta] Add missing dependencies (#5220)

main
zz 2 years ago
committed by GitHub
parent
commit
e21b37c8cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      beta/src/content/learn/separating-events-from-effects.md

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

@ -796,6 +796,22 @@ With `useEvent`, there is no need to "lie" to the linter, and the code works as
<Sandpack>
```json package.json hidden
{
"dependencies": {
"react": "experimental",
"react-dom": "experimental",
"react-scripts": "latest"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
```
```js
import { useState, useEffect } from 'react';
import { experimental_useEvent as useEvent } from 'react';

Loading…
Cancel
Save