Thanks for shared, it's very helpful, but i have a case, can you please help me clear blog.axlight.com/posts/four-patter...
const App = props => { const [stateA, dispatchA] = useReducer(reducerA, initialStateA); const [stateB, dispatchB] = useReducer(reducerB, initialStateB); const [stateC, dispatchC] = useReducer(reducerC, initialStateC); const valueA = useMemo(() => [stateA, dispatchA], [stateA]); const valueB = useMemo(() => [stateB, dispatchB], [stateB]); const valueC = useMemo(() => [stateC, dispatchC], [stateC]); return ( {props.children} ); }; how the useMemo work? many thanks
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for shared, it's very helpful, but i have a case, can you please help me clear
blog.axlight.com/posts/four-patter...
const App = props => {
const [stateA, dispatchA] = useReducer(reducerA, initialStateA);
const [stateB, dispatchB] = useReducer(reducerB, initialStateB);
const [stateC, dispatchC] = useReducer(reducerC, initialStateC);
const valueA = useMemo(() => [stateA, dispatchA], [stateA]);
const valueB = useMemo(() => [stateB, dispatchB], [stateB]);
const valueC = useMemo(() => [stateC, dispatchC], [stateC]);
return (
{props.children}
);
};
how the useMemo work? many thanks