diff --git a/components/switch/demo/disabled.md b/components/switch/demo/disabled.md index c7ce2543ea..54f6041cb3 100644 --- a/components/switch/demo/disabled.md +++ b/components/switch/demo/disabled.md @@ -16,17 +16,15 @@ Disabled state of `Switch`. ````jsx import { Switch, Button } from 'antd'; -const Test = React.createClass({ - getInitialState() { - return { - disabled: true, - }; - }, - toggle() { +class App extends React.Component { + state = { + disabled: true, + } + toggle = () => { this.setState({ disabled: !this.state.disabled, }); - }, + } render() { return (