You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
587 B
28 lines
587 B
2 years ago
|
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;
|