Skip to content

Instantly share code, notes, and snippets.

View shawn42's full-sized avatar

Shawn Anderson shawn42

  • Cisco
  • Holland, MI
View GitHub Profile
@blainekasten
blainekasten / connect-context.js
Last active June 2, 2020 15:52
Use Redux Connect, with context in your map* methods!
import React from 'react';
import { connect as reduxConnect } from 'react-redux';
function wrapWithContext(mapStateToProps, mapDispatchToProps, contextTypes, component) {
return class ConnectedComponent extends React.Component {
constructor(props, context) {
super(props, context);
/*
* This is the magic right here!