3. Put Logic in a Render Function



Hi ! I'm stuck at this exercise : 3. Put Logic in a Render Function with instruction 2

There is no error message and I'm pretty sure I'm right.
This is my code :

var Friend = React.createClass({
  render: funtion () {
  	return (

Help ! Thanks !


The word function is written wrong

var Friend = React.createClass({
  render: **function** () {
  	return (


You're right. But this doesn't work even with function well written :confused:


I had the same trouble. Make sure your friend variable starts on line 20. This fixed it for me.


I'm on line 20 and still nothing !


I've just reset the exercise and pasted my working code, and It said I was wrong on the second point.
I then commented out the code and went through it step by step, without changing anything. And it's now working.
So i think it's just a bit temperamental about what it accepts. Here is my code:

var Friend = React.createClass({
  render: function(){
   var friend = friends[0];
    return (<div><h1>{friend.title}</h1>
      <img src={friend.src} /></div>)


hope this helps.


Nope, I still have my issue


do the job


I don't understand your answer :confused:


3 posts were split to a new topic: Problem with function in render


So. I reset the exercice and use this code : (I started on line 21 and note 20 as it's said)


I am also having a hard time with this one, and none of the solutions worked for me.


React is dependent upon the space before />, I believe.


I have the same problem, dont reload the browser, but try to reset the exercises, and start from the first quesiton again. Hope this helps



I meant Restart the exercise. (not reset). You can do this by clicking of Get Help (Bottom Right coner of your browser) and then choose I want to restart the exercise


Thank you so much! I was stuck on this for nearly two days. Seems codecademy is being fickle - I had the same code, but I had to format it in the exact way you did.


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