Disconnect

Disconnects a component from redux store and removes all mapStateToProps, mapDispatchToProps & mergeProps.

How it works

  • Removes mapStateToProps definition (if present)
  • Removes mapDispatchToProps definition (if present)
  • Removes mergeProps definition (if present)
  • Unwraps exported (returned, if it's a HOC) component from connect (if present)
  • Removes connect import statement (if present)

Works with

  • Functional components defined as an arrow function
  • Functional components defined as a function
  • Class components
  • Higher order functional components defined as an arrow function
  • Higher order functional components defined as a function
  • Higher order class components

Packages

  • react
  • react-redux

Examples

© 2018 - 2019 Kamil Mielnik & Yuriy Yakym. All rights reserved.