Skip to content

Arghyahub/Manageit-Frontend

Repository files navigation

Include Files

import { useRecoilState } from 'recoil';
import { alertAtom , loadingAtom } from "../atom/global";

* To Show an alert

  1. Set
const [alertState, setalertState] = useRecoilState(alertAtom) ;
  1. Call
setShowAlert({open: true, text: "Your text", eventType: "success"})
  • eventType Options: success, error, info, warning

* To Show loading screen

  1. 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