UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

22 lines 624 B
import * as React from 'react'; import { View, Text } from 'react-native'; export class ErrorBoundary extends React.Component { state = { hasError: false }; static getDerivedStateFromError(error) { return { hasError: true, error }; } render() { if (this.state.hasError) { return /*#__PURE__*/React.createElement(View, { testID: "hasError" }, /*#__PURE__*/React.createElement(Text, null, "hasError"), /*#__PURE__*/React.createElement(Text, null, JSON.stringify(this.state.error))); } return this.props.children; } } //# sourceMappingURL=ErrorBoundary.js.map