Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
React-Redux migration from 5.x to 7.x broke `connect`

I'm trying to upgrade from react-redux (https://www.npmjs.com/package/react-redux) to 7.x from 5.x, to use hooks and have reached some breaking changes with the connect() function. It keeps giving me an error that I must wrap my app in a provider, which I already have.

Error:

Uncaught (in promise) Invariant Violation: Could not find "store" in either the context or props of "Connect(DateRangeSelector)". Either wrap the root component in a <Provider>, or explicitly pass "store" as a prop to "Connect(DateRangeSelector)".

Provider Code:

import React from 'react';
import { Provider } from 'react-redux';

import store from 'scripts/setup';
import FullReactComponent from 'root/FullReactComponent';


const App = () => (
  <Provider store={store}>
      <FullReactComponent />
  </Provider>
);

export default App;

Connect code:

FullReactRootComponent.propTypes = {
  bgColor: PropTypes.string.isRequired,
};

export const mapStateToProps = ({ portal }) => ({
  bgColor: portal.get('bgColor'),
});

export const mapDispatchToProps = {
  fetchEnabledRoutes: actions.fetchEnabledRoutes,
};

export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(FullReactRootComponent);

Has anyone ran into this issue upgrading as well? Is there a change in the connect API?

Edit: Here's an example of how Connect isn't being called properly between two snapshots:

5.x:

 <Connect(ModalComponent) open={true}>
   <ModalAdd /> 
</Connect(ModalComponent)>

7.x:

<ModalComponent
  open={true}
/>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

From @markerikson, it turned out I had duplicate copies of react-redux in my yarn.lock. To fix, I put react-redux in resolutions in package.json, and forced it to be 7.x for any shared libraries.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!