We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6f4073b + ef54424 commit cd4c27dCopy full SHA for cd4c27d
1 file changed
packages/module/src/ErrorBoundary/ErrorBoundary.tsx
@@ -41,15 +41,24 @@ class ErrorBoundary extends React.Component<React.PropsWithChildren<ErrorPagePro
41
return { hasError: true, error, historyState: history.state };
42
}
43
44
- render() {
45
-
+ updateState = () => {
46
if (this.state.historyState !== history.state) {
47
this.setState({
48
hasError: false,
49
historyState: history.state,
50
});
51
+ };
52
+
53
+ componentDidUpdate(): void {
54
+ this.updateState();
55
+ }
56
57
+ componentDidMount(): void {
58
59
60
61
+ render() {
62
if (this.state.hasError) {
63
if (this.props.silent) {
64
return null;
0 commit comments