Pass a components state : Stuck at 5/6


#1

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


Get no error messages, but something is wrong with the way the state is passed through the attribute "name". Anyone got any idea what could be causing this?


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 (
      <Child name={this.state.name}/>
    );
  }  
});


#2

Are you rendering the Parent component?

Could it be as simple as the missing space character before /?


#3

Was this ever resolved? I have the same issue.


#4

don't forget to module.exports =Child in your child.js!


#5

It works fine..Thanks alot


#6

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