UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

20 lines 437 B
import React from 'react'; import { isPlainObject } from '../../_util/is'; const useSpinProps = loading => { const spinProps = React.useMemo(() => { if (typeof loading === 'boolean') { return { spinning: loading }; } if (isPlainObject(loading)) { return { spinning: true, ...loading }; } return {}; }, [loading]); return spinProps; }; export default useSpinProps;