40 lines
893 B
JavaScript
40 lines
893 B
JavaScript
// Metro module 3969 (f3970).
|
|
import { Component } from "react";
|
|
import { ManaContext } from "./Module3965";
|
|
class RiveErrorBoundary extends Component {
|
|
static contextType = ManaContext;
|
|
state = {
|
|
hasError: false
|
|
};
|
|
static getDerivedStateFromError() {
|
|
return {
|
|
hasError: true
|
|
};
|
|
}
|
|
componentDidCatch(a0) {
|
|
const context = this.context;
|
|
const captureException = context.captureException;
|
|
if (captureException != null) {
|
|
captureException.call(context, a0, {
|
|
rive_render_failed: "true"
|
|
});
|
|
}
|
|
}
|
|
render() {
|
|
let r5;
|
|
const hasError = this.state.hasError;
|
|
const props = this.props;
|
|
if (hasError) {
|
|
let fallback = props.fallback;
|
|
if (fallback == null) {
|
|
fallback = null;
|
|
}
|
|
r5 = fallback;
|
|
} else {
|
|
r5 = props.children;
|
|
}
|
|
return r5;
|
|
}
|
|
}
|
|
export { RiveErrorBoundary };
|