function DataProvider({ children }) {
  const [data, dispatchData] = useReducer(dataReducer, initialState);
  return (
    <DataContext.Provider value={{ data, dispatchData }}>
      {children}
    </DataContext.Provider>
  );
}
// This uses the useReducer hook to allow access to state and provide functions to dispatch actions to update state
This uses the useReducer hook to allow access to state and provide functions to dispatch actions to update state
This uses the useReducer hook to allow access to state and provide functions to dispatch actions to update state
function DataProvider({ children }) {
  const [data, dispatchData] = useReducer(dataReducer, initialState);
  return (
    <DataContext.Provider value={{ data, dispatchData }}>
      {children}
    </DataContext.Provider>
  );
}
function DataProvider ( { children } ) { const [ data , dispatchData ] = useReducer ( dataReducer , initialState ) ; return ( < DataContext . Provider value = { { data , dispatchData } } > { children } < / DataContext . Provider > ) ; }
This uses the useReducer hook to allow access to state and provide functions to dispatch actions to update state
This uses the useReducer hook to allow access to state and provide functions to dispatch actions to update state