Closed sampolahtinen closed 5 years ago
I didn't realise, but absolutely. If this is causing warnings at any point during the build, when running we should prioritise this.
This seems to be a good reason to kickstart a full upgrade of the component to use the recommended class syntax, and other React recommendations
Hi!
I've been enjoying using your library at work but I've experienced issues related to the deprecated lifecycle hook componentWillReceiveProps
.
I wouldn't know how to reproduce the issue outside of our application, but what ended up happening was that columnCount was not consistent with the supplied breakpointCols prop.
We fixed it by moving the execution of this.reCalculateColumnCount()
from componentWillReceiveProps to componentDidUpdate
. It would be great to see that integrated in your library and I could open a PR for it if that's ok.
Love the library. Just a heads up if you run the module under React.StrictMode, we get the following warning:
componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Masonry
Is anyone working on this ATM? I would definitely be up for it if not!
I would definitely be up for it if not!
@georgedoescode PR is very welcomed. I'll merge it asap
Hi :)
First of all, great work here! I like the simplicity of this package.
Going through the source I noticed that the code still uses componentWillReceiveProps:
https://github.com/paulcollett/react-masonry-css/blob/master/src/react-masonry-css.js
As it is deprecated method, I propose to change it to componentDidUpdate() or alternative method.
I can give it a look if time allows :)