What is the Problem?
So, the problem is that we are fetching data from our database, and before the data arrives, the page is already rendered and we get an error saying that the data we're referencing is undefined.
What is the Solution?
There are 2 solutions:
1. Use promises (I didn't do it this way)
2. Have a check to make sure that we have defined data. (I did it this way)
This allows us to render our event data WHEN we have data retrieved from our asynchronous eventShowAttempt call - effectively, allowing us to workaround the undefined problem.
Don't forget to join the mailing list and our facebook group below if you need some programming help or some accountability partners (And access to our files used in this tutorial series)!
Accompanying medium article: / reactjs-episode-3
Don't forget to like, comment, and subscribe!!!
========================================================
Reference Links
========================================================
None!
========================================================
Connect with me!
========================================================
Linkedin: / donaldlee50
Instagram: / donlee50
Twitter: / donaldlee50
Youtube: / coursehack
Mailing List: http://bit.ly/coursehack-mailing-list
Coursehack's Facebook Group: bit.ly/join-coursehack-facebook-group
========================================================
Ran into this Issue with my Dancingnomads App, check it out!
========================================================
Web: https://dancingnomads.com
iOS App (help give it 5 stars?): http://bit.ly/dancingnomads-for-ios
Android App (help give it 5 stars?): http://bit.ly/dancingnomads-for-android
Don't forget to like, comment, and subscribe!