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

Share this video with your friends

Send Tweet

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.

Alexander
Alexander
~ 9 years ago

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

Pauli Jokela
Pauli Jokela
~ 9 years ago

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.

Tyler McGinnis
Tyler McGinnis(instructor)
~ 9 years ago

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.

egghead eggo
egghead eggo
~ 9 years ago

The lesson video has been updated!

weeniearms
weeniearms
~ 9 years ago

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.

Tyler McGinnis
Tyler McGinnis(instructor)
~ 9 years ago

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

Romuald Quantin
Romuald Quantin
~ 9 years ago

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