diff --git a/components/radio/demo/radiogroup.md b/components/radio/demo/radiogroup.md index e625af8689..7f02f648f0 100644 --- a/components/radio/demo/radiogroup.md +++ b/components/radio/demo/radiogroup.md @@ -16,29 +16,23 @@ A group of radio components. ```jsx import { Radio } from 'antd'; -class App extends React.Component { - state = { - value: 1, - }; +const App = () => { + const [value, setValue] = React.useState(1); - onChange = e => { + const onChange = e => { console.log('radio checked', e.target.value); - this.setState({ - value: e.target.value, - }); + setValue(e.target.value); }; - render() { - return ( - - A - B - C - D - - ); - } -} + return ( + + A + B + C + D + + ); +}; ReactDOM.render(, mountNode); ```