Use static getDerivedStateFromError insteaf of componentDidCatch
componentDidCatch will be deprecated in a future version, it is recommanded to use getDerivedStateFromError instead.
https://reactjs.org/docs/react-component.html#componentdidcatch
componentDidCatch will be deprecated in a future version, it is recommanded to use getDerivedStateFromError instead.
https://reactjs.org/docs/react-component.html#componentdidcatch