From e21b37c8cc8b4e308015ea87659f13aa26bd6356 Mon Sep 17 00:00:00 2001 From: zz <2418184580@qq.com> Date: Sat, 29 Oct 2022 17:01:02 +0800 Subject: [PATCH] [Beta] Add missing dependencies (#5220) --- .../learn/separating-events-from-effects.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/beta/src/content/learn/separating-events-from-effects.md b/beta/src/content/learn/separating-events-from-effects.md index cddd9e47..7a823b1f 100644 --- a/beta/src/content/learn/separating-events-from-effects.md +++ b/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 +```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';