Skip to content

Instantly share code, notes, and snippets.

View gcazaciuc's full-sized avatar

Cazaciuc Gabriel gcazaciuc

  • Cluj Napoca, Romania
View GitHub Profile
@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}