             hidden: not LayoutStore.isShown()
         }
 
+    shouldComponentUpdate: (nextProps, nextState) ->
+        return not(_.isEqual(nextState, @state)) or not (_.isEqual(nextProps, @props))
+
     render: ->
         toasts = @state.toasts.map (toast, id) ->
             Toast {toast, key: id}

        if hasErrors
            showModal = @showModal.bind(this, toast.errors)

        div className: classes, role: "alert",
            if @state.modalErrors
                renderModal()


            LayoutActionCreator.toastsHide()

    closeAll: ->
        LayoutActionCreator.clearToasts()

    _clearToasts: ->
        setTimeout ->
            Array.prototype.forEach.call document.querySelectorAll('.toast-enter'), (e) ->
                e.classList.add 'hidden'
        , 10000

    componentDidMount: ->
        @_clearToasts()

    componentDidUpdate: ->
        @_clearToasts()
