title: How to use connected-react-router with redux-react-hook
body: <p>I am new to react, I would like to use react hooks with redux (with redux-react-hook) with routing (I use connected-react-router but I can switch to another lib)</p>
  
  <p>I pass the store to the StoreContext Provider, everything is okay, but when I add the ConnectedRouter with the right context I get errors.</p>
  
  <p>Here is what I am trying</p>
  
  <pre><code>//index.js
  import { Route, Switch } from 'react-router-dom';
  import { ConnectedRouter } from 'connected-react-router';
  import { StoreContext, store, history } from './store';
  
  ReactDOM.render((
      &lt;StoreContext.Provider value={store}&gt;
          &lt;ConnectedRouter history={history} context={StoreContext}&gt;
              &lt;Switch&gt;
                  &lt;Route path="/" component={App}&gt;&lt;/Route&gt;
              &lt;/Switch&gt;
          &lt;/ConnectedRouter&gt;
      &lt;/StoreContext.Provider&gt;
  ), document.getElementById('root'));
  </code></pre>
  
  <pre><code>//store.js
  import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';
  import { applyMiddleware, createStore } from 'redux';
  import { create } from 'redux-react-hook';
  import { routerMiddleware } from 'connected-react-router';
  import { createBrowserHistory } from 'history';
  import {promiseMiddleware } from './middlewares'
  import createRootReducer from './reducer'
  
  export const { StoreContext, useDispatch, useMappedState } = create();
  export const history = createBrowserHistory();
  export const store = createStore(
      createRootReducer(history),
      {}, //preloadedState
      composeWithDevTools(applyMiddleware(
          routerMiddleware(history),
          promiseMiddleware
      ))
  );
  </code></pre>
  
  <p>But i receive this error :</p>
  
  <pre><code>TypeError: sourceSelector is not a function
  Connect.selectDerivedProps
  C:/Users/NG7F61C/Documents/PROJECTS/1 - IJET/Sources/frontend/node_modules/react-redux/es/components/connectAdvanced.js:112
    109 | 
    110 |   lastProps = props;
    111 |   lastState = state;
  &gt; 112 |   var nextProps = sourceSelector(state, props);
        | ^  113 |   lastDerivedProps = nextProps;
    114 |   return lastDerivedProps;
    115 | };
  </code></pre>
  
  <p>Am I doing something wrong or ConnectedRouter is not compatible with redux-react-hook ?</p>