mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
28 lines
587 B
TypeScript
28 lines
587 B
TypeScript
|
import React, { useState } from 'react';
|
||
|
import { Button, Radio } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [disabled, setDisabled] = useState(true);
|
||
|
|
||
|
const toggleDisabled = () => {
|
||
|
setDisabled(!disabled);
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<Radio defaultChecked={false} disabled={disabled}>
|
||
|
Disabled
|
||
|
</Radio>
|
||
|
<Radio defaultChecked disabled={disabled}>
|
||
|
Disabled
|
||
|
</Radio>
|
||
|
<br />
|
||
|
<Button type="primary" onClick={toggleDisabled} style={{ marginTop: 16 }}>
|
||
|
Toggle disabled
|
||
|
</Button>
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|