What other properties?


#1


https://www.codecademy.com/courses/react-102/lessons/container-presentational-components/exercises/container-presentational-components-apply


error message:
GuineaPigs should have a render function, but no other properties


var React = require('react');


var GuineaPigs = React.createClass({
   render: function () {
    var src = this.props.src;
  }
});

module.exports = GuineaPigs;


#2

The render property should return a JSX object.


#3

Thanks!! but instructions are:

Inside of the render function, delete this line of logic:

var src = GUINEAPATHS[this.state.currentGP];

... and replace it with this:

var src = this.props.src;

Lastly, delete the var GUINEAPATHS array.

I'm stuck


#4

These courses are difficult to test code in. My code is completed, but I can't say where the steps were completed, and mine does have a returned JSX object. Short of wiping out all my own work to reproduce this error, there is nothing else I can suggest.

I think you may have deleted too much code. This is what the render: function should look like:

  render: function () {
    var src = this.props.src;
    return (
      <div>
        <h1>Cute Guinea Pigs</h1>
        <img src={src} />
      </div>
    );
  }

See if that doesn't fix things for you.


#5

many many many thanks!!


#6

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