Unverified Commit ccf84ae5 authored by Licho's avatar Licho Committed by GitHub

fix: flushSync problem (#2581)

* fix: fix flushSync problem * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent e38c814c
......@@ -27,7 +27,6 @@ import {
useEffect,
useState
} from 'react';
import { flushSync } from 'react-dom';
import { useModel } from 'umi';
export interface FullScreenContextProps {
fullscreen: boolean;
......@@ -44,12 +43,10 @@ export const FullScreenProvider: FC = memo(({ children }: any) => {
const { initialState, setInitialState } = useModel('@@initialState');
useEffect(() => {
flushSync(() => {
setInitialState((s) => ({
...s,
fullscreen
}));
});
setInitialState((s) => ({
...s,
fullscreen
}));
}, [fullscreen]);
return (
<FullScreenContext.Provider value={{ fullscreen, setFullscreen }}>
......
......@@ -267,7 +267,7 @@ export default () => {
>
{l('button.heartbeat')}
</Button>
</Authorized>,
</Authorized>
];
const renderListItem = (item: Cluster.Instance) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment