Issues with conditional rendering on leaderboard project

Issues with conditional rendering on leaderboard project
0.0 0

#1

I have created two different components to render based on the data the user wishes to display. The app should show the recent top users by default and the all time users when you press the “all time points” button.

I have linked here the main app code:

The two components code:
https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/RecentUsers.js

https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/AlltimeUsers.js

and a link to the the actual app: https://purpledrumsticks.github.io/FCC-Leaderboard/

I have not styled the project, so it may be a lil ugly. Please forgive me. :sweat_smile:

If anyone can shed light on what I am doing wrong I will love them forever <333


#2

Replace arrow functions with regular functions in App.js and use arrow function or bind in onClick.


#3

Thank you for taking a look! I made some changes to App.js… but things still aren’t working. Is there something I need to add to the other two components? I have looked at quite a bit of code online and everything seems to be written correctly.

Here is a link to the code: https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/App.js


#4

No = in setState

this.setState({
  // do the thing
});

#5

HOLY MOLY. That one really stumped me. I have the conditional rendering working now. THANK YOU SO MUCH. As promised, I love you forever now. <33333