collingo / react-transition-manager

A robust transition component for React projects
http://collingo.com/react-transition-manager/
MIT License
61 stars 7 forks source link

Adding classes #4

Closed ntucker closed 7 years ago

ntucker commented 8 years ago

How do you do it? The demo doesn't seem to have anything also seems to defeat the purpose.

collingo commented 8 years ago

The classes are passed down to the child components in the className property. These need to be applied during the render method to take affect.

var ChildComponent = React.createClass({
  render: function() {
    return <div className={this.props.className} />;
  }
});

I will update the readme with instructions, thanks for highlighting this.

Re defeating the purpose - I appreciate this isn't as simple an interface as the original ReactCSSTransitionGroup. One of the key reasons is I didn't want to reach into the DOM in order to manipulate classes but I am open to discussion on whether this should be introduced. It still provides value in you not having to determine what classes need to be applied at any given time - especially given the context of multiple simultaneous transitions occurring together across multiple renders.

collingo commented 8 years ago

I have updated the readme with the className instructions

collingo commented 7 years ago

Closing as not heard of any follow up issues