import { useRecoilState } from 'recoil';
import { alertAtom , loadingAtom } from "../atom/global";
- Set
const [alertState, setalertState] = useRecoilState(alertAtom) ;
- Call
setShowAlert({open: true, text: "Your text", eventType: "success"})
eventType
Options:success
,error
,info
,warning
- Setup file
const [loading, setloading] = useRecoilState(loadingAtom) ;
Without text
setloading({open: true}) ;
With text
setloading({open: true, text: 'Dheriya rakhiye'}) ;
// dont forget to clean out text on loadout