Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Building Applications with React and Redux Getting Started with Redux Redux Initial Setup - index.js

bugs in downloaded project zip file

As of 2017-07-31 the zip file containing the project source code contains bugs that cause the app to not work correctly.

Downloaded file: 1-getting-started-with-redux.zip

I scanned over several of the versions of the project from this zip file and they all had the same bugs.

These are the same bugs I saw in the React Webpack course: https://teamtreehouse.com/community/the-initial-downloaded-code-for-video-2-has-multiple-bugs

These bugs include:

  1. method componentDidMount of Stopwatch uses setInterval without a delay argument. This behavior doesn't seem well-documented by MDN and doesn't seem discussed much on the web. In Firefox (55) the timer fires once and stops rather than repeating

  2. method getInitialState of Stopwatch has a misspelled key previouseTime which causes the stopwatch to not work

You might have to deal with clearing the browser cache to changed code to run

Buggy version of (1):

const Stopwatch = React.createClass({
  getInitialState: function () {
    return ({
      running: false,
      previouseTime: 0,
      elapsedTime: 0,
    });
  },

Corrected version of (1)

const Stopwatch = React.createClass({
  getInitialState: function () {
    return ({
      running: false,
      previousTime: 0,
      elapsedTime: 0,
    });
  },

Buggy version of (2)

  componentDidMount: function () {
    this.interval = setInterval(this.onTick);
  },

A corrected version of (2)

  componentDidMount: function () {
    this.interval = setInterval(this.onTick, 100);
  },