import { useReducer, createContext, useContext } from 'react' const notifReducer = (state, action) => { switch(action.type) { case 'SET': return action.payload case 'CLEAR': return '' default: return state } } export const NotifContext = createContext() export const NotifContextProvider = (props) => { const [ notif, notifDispatch] = useReducer(notifReducer, '') return ( {props.children} ) } export default NotifContext