mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
61d0d6b182
* feat: useBreakpoint hook * update snapshots * update snapshots * update snapshots * add useBreakpoint hook test
601 B
601 B
order | title |
---|---|
10 | useBreakpoint Hook |
zh-CN
使用 useBreakpoint
Hook 个性化布局。
en-US
Use useBreakpoint
Hook povide personalized layout.
import { Row, Col, Grid } from 'antd';
const { useBreakpoint } = Grid;
function UseBreakpointDemo() {
const screens = useBreakpoint();
return (
<Row>
<Col>
Current break point:
{Object.entries(screens)
.filter(screen => !!screen[1])
.map(screen => screen[0])
.join(' ')}
</Col>
</Row>
);
}
ReactDOM.render(<UseBreakpointDemo />, mountNode);