What am I missing here?

<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.>
https://www.codecademy.com/en/courses/react-102/lessons/react-forms/exercises/input-event-handler

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
I am not receiving any written error messages but something is clearly failing since I’m getting a red x with a red background on Step 1. That said, I am absolutely certain I’m missing some key bit in my code and it’s probably something really silly that I forgot. Any enlightenment is much appreciated!

Specifically, I think what is missing has something to do with this bit:

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 <input /> field. You are setting this.state.userInput equal to whatever text is currently in <input />.

```

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

var Input = React.createClass({
handleUserInput: function(e) {
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>

This may have actually been a bug on chrome. I pasted this into an instance of the code academy lesson on Firefox and it worked. o_O

1 Like

just remove semicolons after userInput: e.target.value;

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