juliancwirko / react-s-alert

Alerts / Notifications for React with rich configuration options
https://www.npmjs.com/package/react-s-alert
MIT License
649 stars 75 forks source link

_renderNewRootComponent #25

Closed pcg92 closed 7 years ago

pcg92 commented 7 years ago

Im using meteor to display alerts when some vars changes.

trackNewOrders(){

    Tracker.autorun( (thisTracker) =>{
        var oldest = _.max(this.props.orders,(order) => {
          return order.clock;
        });
        if(oldest.clock){
          if (!_.findWhere(this.state.array, {'_id':oldest._id})) {
            Alert.success('New order, {
              position: 'top-right'
            });
            this.state.array.push(oldest);
          }
        }
    });
  } 

_renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.

I dont understand that error

ashwintastic commented 7 years ago

even I'm getting the same error