title: Function doesn't enter in the dispatch in React / Redux
body: <p>I'm working on a personal React project with Redux and I've an issue. All my redux functions are working well except one. I want to load  all the requests into the redux. In requestAction.js, I have the first console.log but not the second from the <code>return function(dispatch)</code>. Have you any idea why ?</p>
  <p>Thank you in advance =)</p>
  <p>Here is my code :</p>
  <pre><code>import React, {useState, useEffect} from &quot;react&quot;
  import {connect} from &quot;react-redux&quot;
  
  import {getAllRequests} from &quot;../../api/requests&quot;
  import {loadAllRequests} from &quot;../../actions/request/requestAction&quot;
  import {convertDate} from &quot;../../utils/utils&quot;
  
  import Header from &quot;../headers/header&quot;
  import HeaderPages from &quot;../headers/headerPages&quot;
  import Footer from &quot;../footer&quot;
  import AdminMenu from &quot;../../components/adminMenu&quot;
  
  const AdminRequests = (props) =&gt; {
  
      const headerTitle =&quot;Administration&quot;
      const headerBreadcrumbs = [{value: &quot;Accueil&quot;, link:&quot;/&quot;},{value: &quot;Administration&quot;, link:&quot;/admin&quot;},{value: &quot;Commandes&quot;, link:null}]
  
      const [displayedRequests, setDisplayedRequests] = useState([])
  
      
      useEffect(() =&gt; {
          loadDatas()
      }, [])
  
      
      useEffect(() =&gt; {
          
          loadDisplayedRequests(props.requests.list)
      }, [props.requests])
  
      const loadDatas = () =&gt; {
          getAllRequests()
          .then(requestsDB =&gt; {
              loadAllRequests(requestsDB) //My redux function
          })
      }
      //Construction de la liste des commandes à afficher
      const loadDisplayedRequests = (requests) =&gt; {
          requests.map((requestItem) =&gt; {
  
                  setDisplayedRequests(displayedRequests =&gt; [...displayedRequests,
                      &lt;article key={requestItem.id} className=&quot;profile-user-request-item&quot;&gt;
                          &lt;section className=&quot;request-item-header&quot;&gt;
                              &lt;p&gt;N°{requestItem.request_number}&lt;/p&gt;
                              &lt;p&gt;du {convertDate(requestItem.request_date)}&lt;/p&gt;
                              &lt;p&gt;Statut : {requestItem.preparation_status}&lt;/p&gt;
                          &lt;/section&gt;
                          &lt;section className=&quot;request-item-resume&quot;&gt;
                              &lt;p&gt;Total&lt;/p&gt;
                              &lt;p&gt;{requestItem.total_amount} € TCC&lt;/p&gt;
                          &lt;/section&gt;
                      &lt;/article&gt;])
          })
      }  
  
      const showDisplayedRequests = () =&gt; {
          return(
              &lt;section&gt;
                  {displayedRequests}
              &lt;/section&gt;
          )
      }
  
      return (    
          &lt;div className=&quot;root&quot;&gt;
                  &lt;Header /&gt;
                  &lt;HeaderPages headerTitle={headerTitle} headerBreadcrumbs={headerBreadcrumbs}/&gt;
                  &lt;section className=&quot;admin-container&quot;&gt;
                      &lt;AdminMenu /&gt;
   
                      &lt;section className=&quot;admin-content&quot;&gt;
                          &lt;h4&gt;Gestion des commandes&lt;/h4&gt;
                          {showDisplayedRequests()}
                      &lt;/section&gt;
                  &lt;/section&gt;
                  &lt;Footer /&gt;
          &lt;/div&gt;
      )
  }
  
  const mapStateToProps = (store) =&gt; {
      return {
          requests: store.requests
      }
  }
  
  const mapDispatchToProps = {
      loadAllRequests
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(AdminRequests)
  </code></pre>
  <p>requestAction.js</p>
  <pre><code>import {LOAD_ALL_REQUESTS} from &quot;./action-type&quot;
  
  export const loadAllRequests = (requests) =&gt; {
      console.log(&quot;requests action = &quot;, requests) //Displayed
      return function(dispatch){
          console.log(&quot;dispatch&quot;) //Not displayed
          dispatch({
              type: LOAD_ALL_REQUESTS,
              payload: requests
          })
      }
  </code></pre>
  <p>requestReducer.js</p>
  <pre><code>import { LOAD_ALL_REQUESTS } from &quot;../actions/request/action-type&quot;
  
  const initialState = {
      list: []
  }
  
  export default function RequestReducer(state = initialState, action) {
      switch(action.type){
          case LOAD_ALL_REQUESTS :
              return {list: action.payload}
          break
  
          default :
              return state
          break
      }
  }
  </code></pre>
  <p>index.js</p>
  <pre><code>import {combineReducers } from &quot;redux&quot;
  import UserReducer from &quot;./userReducer&quot;
  import ProductsReducer from &quot;./productsReducer&quot;
  import RequestReducer from &quot;./requestReducer&quot;
  
  const rootReducer = combineReducers({
      user: UserReducer,
      products: ProductsReducer,
      requests: RequestReducer
  })
  
  export default rootReducer
  </code></pre>