rewrite Switch demos to es6 component, #4878

pull/4964/head
afc163 8 years ago
parent 6455bdf6e1
commit d576abc7b0

@ -16,17 +16,15 @@ Disabled state of `Switch`.
````jsx
import { Switch, Button } from 'antd';
const Test = React.createClass({
getInitialState() {
return {
class App extends React.Component {
state = {
disabled: true,
};
},
toggle() {
}
toggle = () => {
this.setState({
disabled: !this.state.disabled,
});
},
}
render() {
return (
<div>
@ -35,8 +33,8 @@ const Test = React.createClass({
<Button type="primary" onClick={this.toggle}>Toggle disabled</Button>
</div>
);
},
});
}
}
ReactDOM.render(<Test />, mountNode);
ReactDOM.render(<App />, mountNode);
````

Loading…
Cancel
Save