6/2 Seperate Container Components From Presentational components


#1

Im stuck on exercise 6, everytime i put a code in it keeps replying with error, but when i use 'get code' it resets the whole thing and sends me back to exercise 1!! I repeated this task so many times. Can anyone help/

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

this is the question;

GuineaPigsContainer contains a lot of logic. It shouldn't also have to render HTML-like JSX.

Delete any HTML-like JSX from GuineaPigsContainer's render function's return statement. Instead, return an instance of GuineaPigs. The new render function should look like this:

render: function () {
  var src = GUINEAPATHS[this.state.currentGP];
  return <GuineaPigs />;
}

this is what i have;

render: function () {
    var src = GUINEAPATHS[this.state.currentGP];
    return 
      <GuineaPigs src={src} />
  }

Please help


#2

For step 6 to pass, the return line should look like the example...

return <GuineaPigs />;

We don't add the src attribute until step 7.


#3

It keeps passing an error when i use the example, why is this? am i doing it wrong?


#4

i'm stuck here, and the Get Code option doesn't work. i can't progress and also can't start over because there is no Reset button.


#5

same issue for me. also giving error on this step, even though i'm using exact code in instructions!


#6

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