Need Help (6/7)


#1


Greetings, some help with the following would be much appreciated

Components and Advanced JSX LESSON: Use an event listener in a component: Apply your knowledge of JSX to React components.


https://www.codecademy.com/courses/react-101/lessons/react-components-advanced-jsx/exercises/component-event-listener?action=lesson_resume&link_content_target=interstitial_lesson


This is the error it logs:
ReactDOM.render's second argument should be document.getElementById('app').


var React = require('react');
var ReactDOM = require('react-dom');

var Button = React.createClass({
  scream: function () {
    alert('AAAAAAAAHHH!!!!!');
  },

  render: function () {
    return <button onClick={this.scream}>AAAAAH!</button>;
  }
});
ReactDOM.render(<Button />, document.getElementById('app');


#2

You forgot the second parentheses after app.

ReactDOM.render(, document.getElementById('app'));


#3

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