ant-design/components/grid/demo/useBreakpoint.tsx
lijianan c01c1b505b
demo: update Grid、Table、Select demo (#47709)
* demo: update demo

* fix: fix test

* feat: table snap

---------

Co-authored-by: 叶枫 <645381995@qq.com>
2024-03-05 17:23:47 +08:00

23 lines
494 B
TypeScript

import React from 'react';
import { Flex, Grid, Tag } from 'antd';
const { useBreakpoint } = Grid;
const App: React.FC = () => {
const screens = useBreakpoint();
return (
<Flex wrap="wrap" gap="small">
Current break point:
{Object.entries(screens)
.filter((screen) => !!screen[1])
.map<React.ReactNode>((screen) => (
<Tag color="blue" key={screen[0]}>
{screen[0]}
</Tag>
))}
</Flex>
);
};
export default App;