use useEffect to add and remove class in react code example
Example: setting className using useEffect
useEffect(() => {
document.body.className = 'signin';
return () => { document.body.className = ''; }
});
useEffect(() => {
document.body.className = 'signin';
return () => { document.body.className = ''; }
});