The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Building a React.js App: Rendering a UI of Dynamic Data

Building a React.js App: Rendering a UI of Dynamic Data

4:08
In this lesson, we’ll fix up our UserProfile component as well as our Repos component to more elegantly display the data we’re getting from the Github API.
Watch this lesson now
Avatar
egghead.io

In this lesson, we’ll fix up our UserProfile component as well as our Repos component to more elegantly display the data we’re getting from the Github API.

Avatar
Alexander

I currently don't have any followers on Github. After following the tutorial, the spot shows a zero instead of nothing for this space. Any thoughts? Github Username: trebek1

Avatar
Pauli

Seeing the same thing. I just ended up removing both following/followers lines. One solution would be to check their length outside the return() statement and work with that.
Also, "public_repos" is checking for "following", which is wrong.

In reply to Alexander
Avatar
Tyler

Check out this PR which was submitted. https://github.com/tylermcginnis/github-notetaker-egghead/commit/b49d8bf2b8319170b162528e52c8b2870a1b2546. Not sure why you're seeing 0s as those are falsy, but this should just remove those regardless. Let me know if you're still stuck.

In reply to Alexander
Avatar
egghead.io

The lesson video has been updated!

Avatar
weeniearms

The reason why these 0s are shown is because the && operator always returns the first falsy value and react will render anything that's !== undefined.

In reply to Tyler
Avatar
Tyler

Yup. This has been fixed in the Repo just not in the videos yet.

In reply to weeniearms
Avatar
Romuald Quantin

You can get 0 as followers and following, so the test should be bio.followers !== undefined

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?