[client] Use getDerivedStateFromError instead of componentDidCatch in the error-reporter. Fixes #1029