Skip to content

Instantly share code, notes, and snippets.

Created Jan 6, 2020
What would you like to do?
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