import React, { FunctionComponent } from "react"; export function EerrorProtect
(WrappedComponent: FunctionComponent
) { return class extends React.Component
{
state = {
hasErr: false
};
ComponentDidCatch = () => {
this.setState({
hasErr: true
});
};
render() {
const { hasErr } = this.state;
if (hasErr) {
return "sorry Something Wrong";
}
return