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
766 B
28 lines
766 B
import React, { useState } from 'react';
|
|
import type { RadioChangeEvent } from 'antd';
|
|
import { Input, Radio, Space } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [value, setValue] = useState(1);
|
|
|
|
const onChange = (e: RadioChangeEvent) => {
|
|
console.log('radio checked', e.target.value);
|
|
setValue(e.target.value);
|
|
};
|
|
|
|
return (
|
|
<Radio.Group onChange={onChange} value={value}>
|
|
<Space direction="vertical">
|
|
<Radio value={1}>Option A</Radio>
|
|
<Radio value={2}>Option B</Radio>
|
|
<Radio value={3}>Option C</Radio>
|
|
<Radio value={4}>
|
|
More...
|
|
{value === 4 ? <Input style={{ width: 100, marginLeft: 10 }} /> : null}
|
|
</Radio>
|
|
</Space>
|
|
</Radio.Group>
|
|
);
|
|
};
|
|
|
|
export default App;
|
|
|