Warning with react 16.5.0 : "It is not recommended to assign props directly to state..."
yched opened this issue · 2 comments
yched commented
From the react 16.5.0 release notes :
"Warn when this.state is initialized to props react issue 11658"
react-debounce-render does just that, and thus triggers the newly added warning every time :-)
podefr commented
@yched thanks for raising the issue and suggesting a PR. Your solution is a lot more elegant than my original solution and it also fixes a number of issues including using legacy react lifecycle methods or directly persisting props as states which is normally an anti-pattern.
I published version 5.0.0 with the changes from your PR. Please let me know if you're happy with it and feel free to close this issue.
thanks again!