Socket
Socket
Sign inDemoInstall

connect-with-transition-group

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    connect-with-transition-group

Enable ReactTransitionGroup lifecycles on redux 'connected' components


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Install size
2.86 kB
Created
Weekly downloads
 

Readme

Source

connect-with-transition-group

Note: if you want to use it with ReactTransitionGroup and connect this will work, however I suggest just going with this react-motion instead of trying to make ReactTransitionGroup work.

react-redux/connect returns a copy of the component you pass in, so it does not play well with ReactTransitionGroup because that modifies the children directly, which is the copy that connect makes. All this does is calls the lifecycle functions on the copy that connect returns.

npm install --save connect-with-transition-group
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux'
import connectWithTransitionGroup from 'connect-with-transition-group';

class Foo extends Component {
  // ...

  componentWillEnter(cb) {
    // this works!
    cb();
  }

  // ...
}

export default connectWithTransitionGroup(connect(
  mapStateToProps,
  null,
  null,
  // IMPORTANT: must pass this flag to react-redux/connect
  {
    withRef: true,
  }
)(Foo));
import React, { Component, PropTypes } from 'react';
import Foo from './Foo.js';

class Bar extends Component {
  render() {
    return <ReactTransitionGroup>
      <Foo />
    </ReactTransitionGroup>;
  }
}

FAQs

Last updated on 20 Dec 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc