eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.44k stars 145 forks source link

The function componentWillReceiveProps... #53

Closed jrmyio closed 8 years ago

jrmyio commented 8 years ago

The

    componentWillReceiveProps: function() {
        this._timer = setTimeout(function() {
            this.masonry.reloadItems();
            this.isMounted && this.isMounted() && this.forceUpdate();
        }.bind(this), 0);
    },

Is this block really needed as it seems to cause everything to run twice and it seems that I get some minor animation transition problems.

afram commented 8 years ago

This has been there from the beginning (before I started working on it). Have you tried removing the block? It might have been there for an edge case that used to exist. @eiriklv do you have anything to add?

eiriklv commented 8 years ago

@ConneXNL @afram I remember that there was some issues with the masonry not updating in very rare occasions without this hack. But that is a long time ago (many React and Masonry versions ago). Try to remove it and see if things still work as expected and that the tests run. If so you could just remove it :-) Should there be any issues down the line we'll at least have an idea of where to poke.

afram commented 8 years ago

@ConneXNL can you please try @4.2.3-beta to see how it works for you?

afram commented 8 years ago

updated in react-masonry-component@4.3.0