Want I am missing in the below code

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

``` Problem in React Forms - 3rd ex;

Problem statement is - Select Input.js.

Before Input’s render function, write a new property named handleUserInput. Make handleUserInput’s value a function.

Give this function one parameter, named e.

Inside of this function’s body, call this.setState. Set the state’s userInput property equal to e.target.value.

e.target.value will equal the text in the field. You are setting this.state.userInput equal to whatever text is currently in .

Could you anybody help me what i am missing in that code.

var React = require(‘react’);
var ReactDOM = require(‘react-dom’);

var Input = React.createClass({
handleUserInput: function (){
this.setState({
userInput: e.target.value
})
};
render: function () {
return (



I am an h1.



);
}
});

ReactDOM.render(
,
document.getElementById(‘app’)
);

<do not remove the three backticks above>
    <input 
      type="text" 
      onChange={this.handleUserInput} 
      value=""/>

This is correct answer。

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.