# Issues with conditional rendering on leaderboard project

**URL:** <https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308>\
**Category:** General\
**Created:** [April 5, 2017, 3:59pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308 "2017-04-05T15:59:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![purpledrumsticks](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/purpledrumsticks/32/3833_2.png) [@purpledrumsticks](https://forum.freecodecamp.org/u/purpledrumsticks)\
**Post date:** [April 5, 2017, 3:59pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/1 "2017-04-05T15:59:13Z")

</div>

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:

> <https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/App.js>

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

[https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/AlltimeUsers.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/](https://purpledrumsticks.github.io/FCC-Leaderboard/)

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

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

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [April 5, 2017, 6:55pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/2 "2017-04-05T18:55:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![purpledrumsticks](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/purpledrumsticks/32/3833_2.png) [@purpledrumsticks](https://forum.freecodecamp.org/u/purpledrumsticks)\
**Post date:** [April 5, 2017, 11:48pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/3 "2017-04-05T23:48:19Z")

</div>

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](https://github.com/purpledrumsticks/FCC-Leaderboard/blob/master/src/App.js)

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [April 6, 2017, 6:55am UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/4 "2017-04-06T06:55:54Z")

</div>

No `=` in `setState`

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

```

---

<div class="post-metadata">

**Author:** ![purpledrumsticks](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/purpledrumsticks/32/3833_2.png) [@purpledrumsticks](https://forum.freecodecamp.org/u/purpledrumsticks)\
**Post date:** [April 6, 2017, 1:15pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/5 "2017-04-06T13:15:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:52pm UTC](https://forum.freecodecamp.org/t/issues-with-conditional-rendering-on-leaderboard-project/103308/6 "2021-01-17T20:52:03Z")

</div>

Closed on January 17, 2021, 8:52pm UTC


