Skip to content

Instantly share code, notes, and snippets.

@SevenOutman
Created May 16, 2018 11:01
Show Gist options
  • Save SevenOutman/6fda70a4abe24792952b4aa2b893925a to your computer and use it in GitHub Desktop.
Save SevenOutman/6fda70a4abe24792952b4aa2b893925a to your computer and use it in GitHub Desktop.
Use redux like React 16.3 Context API
import { connect } from 'react-redux';
export default connect(
state => ({ state }), // mapState2Props
)(
({ state, dispatch, children }) => children(state, dispatch), // <Store> component
);
export default () => (
<Store>
{state => (
<Table data={state.users} />
)}
</Store>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment