React.js Part 1 10/13 - Need Help!


#1



Followed all the instructions to the letter but the code won't run.


Replace this line with your code. 
//Button.js
var React = require('react');

var Button = React.createClass({
  render: function () {
    return (
      <button onClick = {this.props.onClick} >
        Click me!
      </button>
    );
  }
});

module.exports = Button;

//Talker.js
var React = require('react');
var ReactDOM = require('react-dom');
var Button = require('./Button');

var Talker = React.createClass({
 handleClick: function () {
    for (var speech = '', i = 0; i < 10000; i++) {
      speech += 'blah ';
    }
    alert(speech);
  },
  
  render: function () {
    return <Button onClick =  {this.handleClick} />;
  }
});

ReactDOM.render(
  <Talker />,
  document.getElementById('app')
);


#2

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