- React 15.5.4
- Vanilla JavaScript
This project derived from: Programming Challenges: [Fizz Buzz]
Notes I took for working on this coding challenge
- 2017-04-25 @ 7:35pm
- 8:35pm -> 1.0 hr (got it output to console, but I was missing one huge fault (which I found later while getting output to HTML))
- 12:32am + 2.5 hrs (4 minus 1.5 hr timeout for completing my daily project (GistBox) and got something to eat)
Overall project took about 3.5 hours to fully complete. Plenty of room for improvement.
The biggest issue I faced with this project was in trying to figure out how/when/where to execute the loop/output function
- I determined I needed to execute it both when the component is initially loaded, and when props are updated
componentWillMount() {
this.runCount()
Took about half hour to figure out how not to trigger the infinite 'componentDidUpdate' loop
componentDidUpdate(prevProps, prevState) {
if (prevProps.countToNum != this.props.countToNum) {
this.runCount()
The next issue was that I ended up setting state inside the for loop... Whoops!
- Still not sure how the console.log was showing correctly after my first hour.
- I knew something was wrong when I added a setTimeout() around the setState() and it worked.
- Red Flag -- This is 100% NOT the place for a setTimeout()
I enjoyed working on this project, but definitely need to get my full completion time down.