diff --git a/packages/react-ui/components/SingleToast/SingleToast.tsx b/packages/react-ui/components/SingleToast/SingleToast.tsx index 8c83f17f6b9..1de6b8600f5 100644 --- a/packages/react-ui/components/SingleToast/SingleToast.tsx +++ b/packages/react-ui/components/SingleToast/SingleToast.tsx @@ -16,7 +16,11 @@ export class SingleToast extends React.Component { SingleToast.ref.current?.push(...args); }; public static close: typeof Toast.close = () => { - ReactDOM.flushSync(() => SingleToast.ref.current?.close()); + if (React.version.search('18') === 0) { + ReactDOM.flushSync(() => SingleToast.ref.current?.close()); + } else { + SingleToast.ref.current?.close(); + } }; render = () => { return ;