How can I disable animation in a reactjs component first time -


I have a component with the list of items. I want to add or remove any item in the list for the animation .

  var React CS String group group  

= React.addance. CSSTransitionGroup; Var hello = rect.ct class ({getInitialState: function} {return} {}: {}:}; addColor: function () {this.setState ({items: this.state.items.concat ('new color' }}}}; ComponentDidMount: function () {var items = ['blue', 'red', 'green']; this.setState ({items: items})}, render: function () {var contentList = IT .ts.ints.map (function (i, k) {return (

  • );}); return (
    gt; hello & lt; Button onClick = {this.addColor} & gt; Add & lt; / button & gt; Rect CS Station Group TransitionName = "Example" & gt; {Content List} & lt; / ReactCSSTransitionGroup & gt; & lt; / div & gt; ;)}}); Reaction (& lt; hello name = "world" />, document.body);
  • So, I can change the animation only when the list changes and Not the first setat by the didMount method?

    componentWillMount Instead, componentDidMount will work entirely as shown in this Bela:

    However, if your actual code is to get data in Dedamount, then you can use the ssorallen comment Should not


    Comments

    Popular posts from this blog

    java - Can't add JTree to JPanel of a JInternalFrame -

    javascript - data.match(var) not working it seems -

    javascript - How can I pause a jQuery .each() loop, while waiting for user input? -