- Create an
ErrorBoundarycomponent. Your component should:
- implement
componentDidCatch()which should set the state to indicate that an error occurred - render its children
- if an error happened, render an error message instead
- Wrap this component around your
ContactListContainercomponent
- This component doesn't currently throw errors. Modify it to throw an error if it cannot contact its server.
- Test your
ErrorBoundarycomponent to ensure that it renders the correct content whether an error occurs or not.