Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzz committed Nov 22, 2024
2 parents 7b4acd6 + 767c848 commit bc3364c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-ui/components/SingleToast/SingleToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export class SingleToast extends React.Component<ToastProps> {
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 <Toast ref={SingleToast.ref} {...this.props} />;
Expand Down

0 comments on commit bc3364c

Please sign in to comment.