got to a good point with sighting modal, want to do cleanup
This commit is contained in:
19
src/context/providers/AlertHitProvider.tsx
Normal file
19
src/context/providers/AlertHitProvider.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { useReducer, type ReactNode } from "react";
|
||||
import AlertHitContext from "../AlertHitContext";
|
||||
import { reducer, initalState } from "../reducers/AlertReducers";
|
||||
|
||||
type AlertHitProviderTypeProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export const AlertHitProvider = ({ children }: AlertHitProviderTypeProps) => {
|
||||
const [state, disptach] = useReducer(reducer, initalState);
|
||||
|
||||
return (
|
||||
<AlertHitContext.Provider value={{ state, disptach }}>
|
||||
{children}
|
||||
</AlertHitContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default AlertHitProvider;
|
||||
Reference in New Issue
Block a user