Skip to content

Commit 2bfb2a1

Browse files
authored
Fix useToast example in docs (#5398)
1 parent afe9c35 commit 2bfb2a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@react-aria/toast/docs/useToast.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ In the above examples, each `ToastProvider` has a separate queue. This setup is
313313

314314
```tsx example export=true hidden
315315
import {ToastQueue, useToastQueue} from '@react-stately/toast';
316+
import {createPortal} from 'react-dom';
316317

317318
// Create a global toast queue.
318319
///- begin highlight -///
@@ -329,7 +330,7 @@ function GlobalToastRegion(props) {
329330

330331
// Render toast region.
331332
return state.visibleToasts.length > 0
332-
? ReactDOM.createPortal(<ToastRegion {...props} state={state} />, document.body)
333+
? createPortal(<ToastRegion {...props} state={state} />, document.body)
333334
: null;
334335
}
335336

0 commit comments

Comments
 (0)