@samitouri / QOS-React-2 / commits / 6b539f280d

Convert createClass caller

This snuck in after rebasing

Andrew Clark committed Mar 27, 2017 at 16:33 UTC 6b539f280d8b0ec4874671bae9c6bed80b788006
1 file changed +9 -11
src/renderers/dom/shared/wrappers/__tests__/ReactDOMInput-test.js
+9 -11
@@ -1119,22 +1119,20 @@ describe('ReactDOMInput', () => {
1119
1120 describe('assigning the value attribute on controlled inputs', function() {
1121 function getTestInput() {
1122 - return React.createClass({
1123 - getInitialState: function() {
1124 - return {
1125 - value: this.props.value == null ? '' : this.props.value,
1126 - };
1127 - },
1128 - onChange: function(event) {
1122 + return class extends React.Component {
1123 + state = {
1124 + value: this.props.value == null ? '' : this.props.value,
1125 + };
1126 + onChange = event => {
1127 this.setState({value: event.target.value});
1130 - },
1131 - render: function() {
1128 + };
1129 + render() {
1130 var type = this.props.type;
1131 var value = this.state.value;
1132
1133 return <input type={type} value={value} onChange={this.onChange} />;
1136 - },
1137 - });
1134 + }
1135 + };
1136 }
1137
1138 it('always sets the attribute when values change on text inputs', function() {