import { useEffect } from 'react' ; param className export function useRootClass ( className ) { useEffect ( ( ) => { const { classList } = document . documentElement ; classList . add ( className ) ; return ( ) => { classList . remove ( className ) ; } ; } , [ className ] ) ; }