rewrite Rate demos to es6 component, #4878

pull/4964/head
afc163 8 years ago
parent 18203972a1
commit c8e49995cb

@ -16,16 +16,14 @@ Add copywriting in rate components.
````jsx
import { Rate } from 'antd';
const Rater = React.createClass({
getInitialState() {
return {
value: 3,
count: null,
};
},
handleChange(value) {
class Rater extends React.Component {
state = {
value: 3,
count: null,
}
handleChange = (value) => {
this.setState({ value });
},
}
render() {
const { value } = this.state;
return (
@ -34,8 +32,8 @@ const Rater = React.createClass({
{value && <span className="ant-rate-text">{value} stars</span>}
</span>
);
},
});
}
}
ReactDOM.render(<Rater />, mountNode);
````

Loading…
Cancel
Save