ReactJS: Uncaught TypeError: Cannot read property 'subscribe' of undefined(…)
<p>I am trying to build a timer with React and Redux.</p>

<p>I am separating concerns as much as possible.  Please help me find a working solution! Thank you.</p>

<p>Error: Uncaught TypeError: Cannot read property 'subscribe' of undefined(…)</p>

<p>Timer Component</p>

<pre><code>Timer.js

import React, { Component } from 'react';
import timer from '../reducers/index.js';
import store from '../stores/timerStore.js';


 // React Component to display the timer
 class Timer extends Component {
    constructor() {
     super();
     this.start = this.start.bind(this);
     this.stop = this.stop.bind(this);
    }

    start() {
      store.dispatch({
      type: 'START_TIMER',
      offset: Date.now(),
    });
   }
  stop() {
    store.dispatch({
    type: 'STOP_TIMER'
  });
 }
format(time) {
   const pad = (time, length) =&gt; {
     while (time.length &lt; length) {
     time = '0' + time;
   }
  return time;
}

time = new Date(time);
let m = pad(time.getMinutes().toString(), 2);
let s = pad(time.getSeconds().toString(), 2);
let ms = pad(time.getMilliseconds().toString(), 3);

 return `${m} : ${s} . ${ms}`;
}

render() {
  return (
    &lt;div&gt;
      &lt;h1&gt;Time: {this.format(this.props.time)}&lt;/h1&gt;
      &lt;button onClick={this.props.isOn ? this.stop : this.start}&gt;
       { this.props.isOn ? 'Stop' : 'Start' }
      &lt;/button&gt;
    &lt;/div&gt;
   );
  }
}



export default Timer;
</code></pre>

<p>Timer Reducer </p>

<pre><code>    timer.js

   // Initial state for reducer
   const initialState = {
      isOn: false,
      time: 0
    };


    function timer(state = initialState, action) {
       switch (action.type) {
          case 'START_TIMER':
            return {
             ...initialState,
             isOn: true,
             offset: action.offset,
             };

          case 'STOP_TIMER':
           return {
             isOn: false,
             time: state.time
            };

         case 'TICK':
           return {
            ...state,
            time: state.time + (action.time - state.offset),
            offset: action.time
          };

        default:
        return state;
      }
     }

   export default timer;
</code></pre>

<p>Timer Store</p>

<pre><code>  timerStore.js

  import { createStore } from 'redux';
  import timer from '../reducers/index.js';

  // Create store using the reducer
  export const store = createStore(timer);
</code></pre>

<p>Main App Component</p>

<pre><code>   index.js

   import React, { Component } from 'react';
   import ReactDOM from 'react-dom';
   import Timer from './components/Timer.js';
   import store from './stores/timerStore.js';

   const render = () =&gt; {
      ReactDOM.render(
      &lt;Timer
          time={store.getState().time}
          isOn={store.getState().isOn}
          interval={store.getState().interval}
       /&gt;,
      document.getElementById("app")
     );
    }

    store.subscribe(render);

    var interval = null;
     store.subscribe(() =&gt; {
       if (store.getState().isOn &amp;&amp; interval === null) {
          interval = setInterval(() =&gt; {
           store.dispatch({
        type: 'TICK',
        time: Date.now()
       });
     });
     }
   if (!store.getState().isOn &amp;&amp; interval !== null) {
      clearInterval(interval);
      interval = null;
     }
    });

  render();
</code></pre>