From 24df4eead5ae7379942671f1a41055135ebff53d Mon Sep 17 00:00:00 2001 From: DawnGate Date: Fri, 10 Feb 2023 00:24:40 +0700 Subject: [PATCH] fix: change experimental_useEvent to experimental_useEffectEvent in escape-hatches.md --- beta/src/content/learn/escape-hatches.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beta/src/content/learn/escape-hatches.md b/beta/src/content/learn/escape-hatches.md index 1ce1ac22e18..dd4119bd681 100644 --- a/beta/src/content/learn/escape-hatches.md +++ b/beta/src/content/learn/escape-hatches.md @@ -471,14 +471,14 @@ This is not ideal. You want to re-connect to the chat only if the `roomId` has c ```js import { useState, useEffect } from 'react'; -import { experimental_useEvent as useEvent } from 'react'; +import { experimental_useEffectEvent as useEffectEvent } from 'react'; import { createConnection, sendMessage } from './chat.js'; import { showNotification } from './notifications.js'; const serverUrl = 'https://localhost:1234'; function ChatRoom({ roomId, theme }) { - const onConnected = useEvent(() => { + const onConnected = useEffectEvent(() => { showNotification('Connected!', theme); });