Stuck at 5/6


#1

I can not find anything wrong in my require('./Child'); but I get following error message
Make sure that you require('./Child'); on line 3.


https://www.codecademy.com/en/courses/react-102/lessons/stateless-inherit-stateful-intro/exercises/stateful-parent-component?action=resume


I get following error message:
Make sure that you require('./Child'); on line 3.


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

React.createClass({
  render: function() {
    return <div></div>;
  },
 
  getInitialState: function () {
    return { name: 'Frarthur' };
  }
});


#2

Your code looks right. Sometimes I find it helps to copy the error text and paste it into the code. Weird bug...


#3

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


var Parent = React.createClass({
  getInitialState: function () {
    return { name: 'Frarthur' };
  },
  
  render: function () {
    return <div></div>;
  }
});

This revised version worked for me!


#4

Thanks!
It worked for me too.


#5

Thanks! I copied the code from another answer.


#6

Thanks!
I have found mistake. it's mycase it was line 10 i returned tags

instead


#7

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