[Beta] Add missing dependencies (#5220)

This commit is contained in:
zz
2022-10-29 17:01:02 +08:00
committed by GitHub
parent f4d42d6cfd
commit e21b37c8cc

View File

@@ -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';