react-moment
react-moment copied to clipboard
Support StrictMode
[xxx] Warning: Unsafe lifecycle methods were found within a strict-mode tree:
in StrictMode (at [xxx])
componentWillMount: Please update the following components to use componentDidMount instead: t
componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: t
I was getting thousands of errors in my console when I ran strict mode uncaught TypeError: (n.globalFilter || e.filter) is not a function, not so sure this library is ready for react 18
@dimaqq and other people searching for this problem, I got around this issue of logging like crazy by passing this as a prop to all my callers.
filter={(v) => { return v; }}
It seems like react is not honoring the defaultProps when in strict mode. I am not sure why, I did a google on it but couldnt find a definitive answer.