Growl causes error when message fades out

UI Components for React
Post Reply
kaho29
Posts: 18
Joined: 18 Aug 2017, 10:57

19 Oct 2017, 13:54

I just noticed, that since version 1.1.0 the Growl Component throws a Javascript error when the message is faded out automatically.

I get the following error:

Code: Select all

Uncaught TypeError: Cannot read property 'forEach' of undefined at Growl.js:87
It's this code block that fails:

Code: Select all

{
        key: 'removeAll',
        value: function removeAll() {
            var _this3 = this;

            if (this.state.messages && this.state.messages.length) {
                _DomHandler2.default.fadeOut(this.container, 250);

                setTimeout(function () {
                    _this3.value.forEach(function (msg, index) { // this line fails because _this3.value is undefined when the timeout triggers
                        _this3.invokeOnClose(null, msg);
                    });

                    _this3.setState({
                        messages: null
                    });
                }, 250);
            }
        }
    }


Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests