🐛 修复localstorage无法自动保存的bug

This commit is contained in:
xujiang 2020-10-09 01:06:51 +08:00
parent c9616fc6a5
commit 4655f0cbac

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect, useMemo, useContext, useRef } from 'react'; import React, { useState, useEffect, useMemo, useCallback, useContext, useRef } from 'react';
import { Result, Tabs } from 'antd'; import { Result, Tabs } from 'antd';
import { import {
PieChartOutlined, PieChartOutlined,
@ -152,7 +152,7 @@ const Container = (props: {
} }
}, [context.theme, curPoint, dispatch]); }, [context.theme, curPoint, dispatch]);
const clearData = useMemo(() => { const clearData = useCallback(() => {
if (context.theme === 'h5') { if (context.theme === 'h5') {
dispatch({ type: 'editorModal/clearAll' }); dispatch({ type: 'editorModal/clearAll' });
} else { } else {