mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 17:09:46 +08:00
588ee4cac2
* docs: motion usage case * docs: faq * docs: update
43 lines
847 B
TypeScript
43 lines
847 B
TypeScript
import React from 'react';
|
|
import { Switch, ConfigProvider, Space, Checkbox, Radio, Row, Col } from 'antd';
|
|
|
|
export default () => {
|
|
const [checked, setChecked] = React.useState(false);
|
|
|
|
React.useEffect(() => {
|
|
const id = setInterval(() => {
|
|
setChecked((prev) => !prev);
|
|
}, 500);
|
|
|
|
return () => {
|
|
clearInterval(id);
|
|
};
|
|
}, []);
|
|
|
|
const nodes = (
|
|
<Space>
|
|
<Checkbox checked={checked}>Checkbox</Checkbox>
|
|
<Radio checked={checked}>Radio</Radio>
|
|
<Switch checked={checked} />
|
|
</Space>
|
|
);
|
|
|
|
return (
|
|
<Row gutter={[24, 24]}>
|
|
<Col span={24}>{nodes}</Col>
|
|
|
|
<Col span={24}>
|
|
<ConfigProvider
|
|
theme={{
|
|
token: {
|
|
motion: false,
|
|
},
|
|
}}
|
|
>
|
|
{nodes}
|
|
</ConfigProvider>
|
|
</Col>
|
|
</Row>
|
|
);
|
|
};
|