$ yarn add inducer
// YourComponent.js
import gameReducer from './gameReducer';
import injectReducer from 'inducer';
class YourComponent extends React.Component {
// component logic here
}
export default injectReducer({
game: gameReducer
})(YourComponent);
// App.js
import React from 'react';
import { Provider } from 'react-redux';
import YourComponent from './YourComponent.js'
export default function App({ store }) {
return (
<Provider store={store}>
<!-- this is important as the HOC will get the store
from the context provided by the store provider -->
<YourComponent />
</Provider>
)
}