Skip to content

Instantly share code, notes, and snippets.

@hew
Created January 6, 2020 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hew/90648bcaac46a8634e3993602229998d to your computer and use it in GitHub Desktop.
Save hew/90648bcaac46a8634e3993602229998d to your computer and use it in GitHub Desktop.
Delay Component

delay component

import { useCallback } from 'react';
import {useTimeout} from 'react-use';
export const Delay = ({ms = 1200, children}) => {
const [isReady] = useTimeout(ms);
return isReady() ? children : null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment