I try to update data in the state, but I got error back The error happens when the page refresh
const [local, setLocal] = React.useState(initialState || []);
React.useEffect(() => {
    getLocal();
}, []);
const getLocal = async () => {
    try {
        let lo = await _getData();
        if (lo != null) {
            setLocal(pre=>({...pre, ...lo});
        }
    } catch (err) {
        console.log(err);
    }
};
const [state, dispatch] = React.useReducer(reducer, local);
const store = React.useMemo(() => ({...state, dispatch}), [state]);
Type of error ...
ERROR  Warning: React has detected a change in the order of 
Hooks called by App. This will lead to bugs and errors if not fixed.
   Previous render            Next render
   ------------------------------------------------------
1. useState                   useState
2. useMemo                    useEffect
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^