ant-design/components/grid/hooks/useFlexGapSupport.tsx
二货机器人 6aaa7be029
fix: Grid should support ssr for flex gap (#29586)
* fix: SSR not break Grid

* test: Add hydrate test

* fix lint
2021-03-02 20:29:00 +08:00

12 lines
282 B
TypeScript

import * as React from 'react';
import { detectFlexGapSupported } from '../../_util/styleChecker';
export default () => {
const [flexible, setFlexible] = React.useState(false);
React.useEffect(() => {
setFlexible(detectFlexGapSupported());
}, []);
return flexible;
};