title: Unable to fetch in redux dispatch function
body: <p>First, I'm still new to the React/Redux world.  </p>
  
  <p>I have the following action in my actions/index.js</p>
  
  <pre><code>export function fetchLatestSchedule()
  {
      //const uri = '/rest/schedule';
      console.log("Fetching latest schedule action");
      const uri = 'http://localhost:8585/MissionClockService/rest/schedule';
      return dispatch =&gt; {
          console.log("Fetching latest schedule action function");
          return fetch(uri)
          .then(response =&gt; {
              console.log("response: " + response);
              return response.json().then(body =&gt; ({ response, body }));}
          )
          .then(({ response, body }) =&gt; {
              console.log("Response from schedule fetch: " + body);
            if (!response.ok) {
              dispatch({
                type: SCHEDULE_REQUEST_FAILURE,
                payload: body.error
              });
            } else {
              dispatch({
                type: SET_CONTACTS,
                payload: body
              });
            }
          });
      }
  
  }
  </code></pre>
  
  <p>My store is created in a store/index.js</p>
  
  <pre><code>import {createStore, combineReducers, applyMiddleware} from 'redux';
  import reducers from '../reducers/index';
  import thunk from 'redux-thunk';
  
  const reducer = combineReducers(reducers);
  const store = createStore(reducer, applyMiddleware(thunk));
  
  export default store;
  </code></pre>
  
  <p>And finally my component that uses the action is the following (MissionClockApp.js)</p>
  
  <pre><code>import React, { Component } from 'react';
  import NextContactPanel from './NextContactPanel';
  import CurrentContactPanel from './CurrentContactPanel';
  import ConfigMenu from './components/ConfigMenu';
  import FileModal from './components/FileModal';
  import WebsocketConnection from './components/WebsocketConnection';
  import {fetchDefaultConfig, fetchLatestSchedule} from './actions';
  import {connect} from 'react-redux';
  
  const mapDispatchToProp = dispatch =&gt; {
      return {
          fetchData: function(){
              console.log("Fetching data");
              dispatch(fetchDefaultConfig);
              dispatch(fetchLatestSchedule);
          }
      };
    }
  
  class ConnectedMissionClockApp extends React.Component
  {
      componentDidMount()
      {
          this.props.fetchData();
      }
  
      render()
      {
          return (&lt;div&gt;
              &lt;ConfigMenu/&gt;
              &lt;NextContactPanel/&gt;
              &lt;CurrentContactPanel/&gt;
              &lt;FileModal/&gt;
              &lt;WebsocketConnection/&gt;
          &lt;/div&gt;);
      }
  }
  
  const MissionClockApp = connect(null, mapDispatchToProp)(ConnectedMissionClockApp);
  export default MissionClockApp
  </code></pre>
  
  <p>When I look in the browser debug log, I see my messages up to "Fetching latest schedule action" but then nothing after that, and my REST service isn't getting any sort of request in the GET method.</p>
  
  <p>I'm sure it's something really basic I'm missing but when looking at examples like on <a href="https://redux.js.org/advanced/asyncactions" rel="nofollow noreferrer">https://redux.js.org/advanced/asyncactions</a> or other SO posts, I can't seem to figure out what I'm doing wrong here.  Other than a dispatch(...) call where my console.log and uri set is happening (which I don't care about dispatching a "making a request" state change), my code seems pretty much identical to the examples.</p>
  
  <p>Where did I screw up here?</p>
  
  <p>Thanks!</p>