We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47adefd commit ae6147fCopy full SHA for ae6147f
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
471
472
```js
473
import { useState, useEffect } from 'react';
474
-import { experimental_useEvent as useEvent } from 'react';
+import { experimental_useEffectEvent as useEffectEvent } from 'react';
475
import { createConnection, sendMessage } from './chat.js';
476
import { showNotification } from './notifications.js';
477
478
const serverUrl = 'https://localhost:1234';
479
480
function ChatRoom({ roomId, theme }) {
481
- const onConnected = useEvent(() => {
+ const onConnected = useEffectEvent(() => {
482
showNotification('Connected!', theme);
483
});
484
0 commit comments