connectWithReduxStore.tsx 339 B

1234567891011
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { store } from '../../store/store';
  4. export function connectWithStore(WrappedComponent, ...args) {
  5. const ConnectedWrappedComponent = connect(...args)(WrappedComponent);
  6. return props => {
  7. return <ConnectedWrappedComponent {...props} store={store} />;
  8. };
  9. }