minhtranite / react-notifications

Notification component for ReactJS
https://www.npmjs.com/package/react-notifications
287 stars 64 forks source link

renamed deprecated unsafe lifecycle methods #50

Open user12043 opened 5 years ago

user12043 commented 5 years ago

As of react 16.3, componentWillMount, componentWillUpdate and componentWillReceiveProps lifecycle methods needs to be renamed to supress the warning about deprecation.

warning

more info here: https://hackernoon.com/problematic-react-lifecycle-methods-are-going-away-in-react-17-4216acc7d58b

philn5d-ar commented 4 years ago

Are you guys going to PR this and do another release soon? This is causing issues with SSR since your event registration happens on the server (it causes a memory leak) when this component is in page that's rendered dynamically on the server. It basically turns SSR server into a hobbling zombie.

user12043 commented 4 years ago

I am not going to do release new version. But to fix this issue I need to upgrade the react version too. I am going to make a commit to do this. Maybe your problem is about old version of react. Are you using the same react version with react-notifications in your project?

philn5d-ar commented 4 years ago

react 16.

philn5d-ar commented 4 years ago

But even in React 15, it is not the right place for registering events.

https://react-legacy.netlify.com/docs/react-component.html#componentwillmount