Skip to content

Instantly share code, notes, and snippets.

@nhahv
Created March 18, 2021 01:55
Show Gist options
  • Select an option

  • Save nhahv/e282e2e2bf2be95d0c2c84e10b7f7e02 to your computer and use it in GitHub Desktop.

Select an option

Save nhahv/e282e2e2bf2be95d0c2c84e10b7f7e02 to your computer and use it in GitHub Desktop.
Replace mapDispatchToProps Map to Function

Find

(?si)^const mapDispatchToProps = \{([^(}/)]*)?\};

Replace

const mapDispatchToProps = (dispatch, ownProps) => {
    return bindActionContextCreators({$1}, dispatch, { xPath: ownProps.xPath });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment