import { useTimeout } from 'react-use' ; import styles from './App.module.css' ; interface Props { isInspecting : boolean ; message ? : string ; } function LoadingFallback ( props ) { const { isInspecting , message = 'Loading' } = props ; const [ isReady ] = useTimeout ( 100 ) ; return ( < > < div className = { styles . fallbackBar } data - mode = { isInspecting ? 'inspect' : 'display' } /> { isReady ( ) && < p className = { styles . fallback } > { message } ... < /p>} < />); } export default LoadingFallback ;