title: Redux and React - Keeping component props in sync with state via @connect
body: <p>I have an application set up using React and Redux such that I have a root application component wrapped around a provider (which is passing the store down so that my child components can access state and dispatch) like so:</p>
  
  <pre><code>&lt;Provider store={Store}&gt;
      &lt;RootComponent /&gt;
  &lt;/Provider&gt;
  </code></pre>
  
  <p>My RootComponent essentially uses a JSON file to render Template components that get passed a key and title (
  
  <pre><code>&lt;Application children={children} /&gt;
  </code></pre>
  
  <p>Within one of the children, I've hooked up the state of the application to the Component using the @connect decorator and I'm firing off a dispatcher upon construction to update my 'content' prop like so:</p>
  
  <pre><code>@connect(state =&gt; ({content: state.content}))
  export default class DynamicText extends Component {
  
  constructor(props) {
      super(props);
      var Content = require(`./jsonContent`);
      props.dispatch(loadContent(Content[props.title].elements));
  }
  
  **actions.js**
  export function loadContent(content) {
      return {
          type: 'LOAD_CONTENT',
          content
      };
  }
  
  **reducers.js**
  const initialState = {
  route: null
  };
  
  export default function routeReducer(state = initialState, action) {
      switch (action.type) {
          case LOAD_CONTENT:
              return Object.assign({}, state, {
                  content: action.content
              });
          default:
              return state;
  }
  </code></pre>
  
  <p>The issue I'm having is that when booting up my application, the 'content' prop is undefined - upon page refresh however, it populates with the updated 'content' data from the JSON file. I think the issue may be occurring because initially the state.content  referenced in my @connect decorator is undefined, however I was hoping that the immediate dispatch on the constructor would solve this issue.</p>
  
  <p>Does anyone have experience or recommendations on how I can get this working without a refresh? Is @connect really the best option here or are there alternatives?</p>