Files
Mav-Mobile-UI/src/context/providers/SoundContextProvider.tsx

19 lines
532 B
TypeScript
Raw Normal View History

import { useReducer, type ReactNode } from "react";
import { SoundContext } from "../SoundContext";
import { initalState, reducer } from "../reducers/SoundContextReducer";
type SoundContextProviderProps = {
children: ReactNode;
};
const SoundContextProvider = ({ children }: SoundContextProviderProps) => {
const [state, dispatch] = useReducer(reducer, initalState);
return (
<SoundContext.Provider value={{ state, dispatch }}>
{children}
</SoundContext.Provider>
);
};
export default SoundContextProvider;