Skip to content

Instantly share code, notes, and snippets.

@gcazaciuc
gcazaciuc / redux-connect-as-function-child-component.js
Last active September 19, 2017 15:43
Redux connect as a function child component
import { getUser } from 'selectors/UserSelectors.js';
import { deleteUser } from 'actions/UserActions.js';
export const App = (props) =>
( <Connect>
(state, dispatch) => {
const user = getUser(state); // There is no need for mapStateToProps. Just transform the data and pass it
return (<Component
user={user}