react-moment
react-moment copied to clipboard
Deprecation warning: React 16.9.0 +
Hi,
This library works great for my basic requirement of formatting a given date and timezone. But it's just that I have warning from React 16.9.0 for componentWillMount and componentWillReceiveProps. Is there any ongoing work happening to support the React Hooks version in near future?
react-dom.development.js:11963 Warning: componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount. Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.
"moment": "^2.24.0", "moment-timezone": "^0.5.25", "react-moment": "^0.9.2"
"react": "^16.9.0-alpha.0", "react-dom": "^16.9.0-alpha.0",
Thanks for the feedback. Some simple rewriting can resolve those problems. I'll get on that shortly. I don't have any immediate plans to use hooks. As written, react-moment is very much a class based component and I can't think of any value hooks bring to the table.
Thanks for the feedback. Some simple rewriting can resolve those problems. I'll get on that shortly. I don't have any immediate plans to use hooks. As written, react-moment is very much a class based component and I can't think of any value hooks bring to the table.
thanks in advance @headzoo the console warnings are just kicking me off. Did a quick resolve on myself until your update arrives.
@headzoo maybe we can have just quickfix for now with renaming those methods to eliminate warnings? Anyway some day react will move forward and this lib probably too right?
@egemon i just have created a pull request #99 . Have a look whether this solves your issue for now.
Any updates on getting this merged @headzoo ?
Is there any updates on this?
I believe this was handled in https://github.com/headzoo/react-moment/pull/102. The most recent version doesn't use componentWillMount.
oddly I am still getting the error when using react moment... 0.9.7 is installed which is after the merge you mentioned. Going to try and track it down.