title: Redux works in dev, seems to break in production
body: <p>I have an Electron desktop application containing a React + Redux app. Redux works fine whilst running the app locally in development, but does not update components once the app has been built to a native desktop app. </p>
  
  <p>Many articles and issues seem to think that the store is configured incorrectly, or that I am mutating state directly rather than updating it, or that my <code>mapStateToProps</code> function is not set up correctly. </p>
  
  <p>I can't see how any of these can be an issue, as my app works during development, and I can see the store be updated and the component re-renders. </p>
  
  <p>In production though, the following happen: </p>
  
  <ul>
  <li>The store state is initialized</li>
  <li>An action is dispatched</li>
  <li>The state updates ( I can see in the dev tools )</li>
  <li>None of my connected components re-render with updated props.</li>
  </ul>
  
  <p>The only difference I can see between development and production is that within Electron, during dev the app is loaded via <code>http://localhost</code>, and during production it is loaded via <code>file:///</code> </p>
  
  <p>My store is configured as: </p>
  
  <pre class="lang-js prettyprint-override"><code>export const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)));
  </code></pre>
  
  <p>The store is provided as: </p>
  
  <pre><code>&lt;Provider store={store}&gt;
      &lt;App /&gt;
  &lt;/Provider&gt;
  </code></pre>
  
  <p>I am connecting my component to the store as: </p>
  
  <pre class="lang-js prettyprint-override"><code>const mapStateToProps = (state: RootState) =&gt; {
      return {
          hasLoaded: state.products.hasLoaded,
          products: state.products.products
      };
  };
  
  const mapDispatchToProps = {
      getProducts: getProducts
  };
  
  export default connect(
      mapStateToProps,
      mapDispatchToProps
  )(ProductsList);
  </code></pre>
  
  <p>Then calling getProducts from within the component like:</p>
  
  <pre class="lang-js prettyprint-override"><code>componentDidMount() {
      this.props.getProducts();
  }
  </code></pre>
  
  <p>I expect the state to be updated with the retrieved products, and then the component should re-render with the updated store state as props.</p>
  
  <p>Instead, the store state is updated - <a href="https://i.stack.imgur.com/AC8cx.png" rel="nofollow noreferrer">as I can see it in Redux DevTools</a> - but the connected component never re-renders, nor does <code>componentDidUpdate</code> get called.</p>