Press Run, nothing happens

<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/child-updates-parents-state/exercises/child-parent-pass-handler?action=lesson_resume

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

Hi! I am facing a bug at exercise 3. When I press Run, the progress marker spins for a while, but then stops and nothing happens. Sometimes if I refresh the page or log out/log in again, pressing Run will result in a ‘failure’ box, but without any message appearing on the screen to help me. I’ve tried this on Opera and Chrome so I don’t think it’s platform-dependent. Please help.

```

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

var Parent = React.createClass({
getInitialState: function () {
return { name: ‘Frarthur’ };
},

handleChange : function (newName) {
this.setState({
name: newName
});
},

render: function () {
return (

);
}
});

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

<do not remove the three backticks above>

Mine is doing the exact same thing :frowning:

First off, you should change the function name of handleChange to changeName as that’s what the instructions called for. Secondly, it should be onChange={this.changeName} not this.props.foo. If you insist on keeping your function name, update your onChange={this.props.handleChange} to onChange={this.handleChange} but I can’t guarantee that the tests the code academy shell runs will accept it rather than pass an error. i.e. “Press Run, nothing happens”

Mine is doing the same thing. tried both this.changeName and this.props.changeName

As of today, I got it to work using this.changeName . I’m not sure why this worked as the very next exercise is showing this.props.changeName ? I don’t remember if I tried this.changeName yesterday.

I was able to debug for Digital Slayer b/c his code was posted. If anything, use a diff checker between your code and Slayer’s and find out what the other difference is.

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