@storybook/addon-ondevice-notes 6.5.6 → 6.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ErrorBoundary.d.ts +13 -0
- package/dist/ErrorBoundary.js +31 -0
- package/package.json +3 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export declare class ErrorBoundary extends React.Component<{
|
|
3
|
+
children: ReactNode | ReactNode[];
|
|
4
|
+
}, {
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
}> {
|
|
7
|
+
constructor(props: any);
|
|
8
|
+
static getDerivedStateFromError(_error: any): {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
};
|
|
11
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
12
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ErrorBoundary = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
class ErrorBoundary extends react_1.default.Component {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
this.state = { hasError: false };
|
|
14
|
+
}
|
|
15
|
+
static getDerivedStateFromError(_error) {
|
|
16
|
+
// Update state so the next render will show the fallback UI.
|
|
17
|
+
return { hasError: true };
|
|
18
|
+
}
|
|
19
|
+
componentDidCatch(error, errorInfo) {
|
|
20
|
+
// You can also log the error to an error reporting service
|
|
21
|
+
console.warn(error, errorInfo);
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
if (this.state.hasError) {
|
|
25
|
+
// You can render any custom fallback UI
|
|
26
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.Text, { children: "Something went wrong." });
|
|
27
|
+
}
|
|
28
|
+
return this.props.children;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ErrorBoundary = ErrorBoundary;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-ondevice-notes",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.7",
|
|
4
4
|
"description": "Write notes for your react-native Storybook stories.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@storybook/client-api": "^6.5.14",
|
|
35
35
|
"@storybook/client-logger": "^6.5.14",
|
|
36
36
|
"@storybook/core-events": "^6.5.14",
|
|
37
|
-
"@storybook/react-native-theming": "^6.5.
|
|
37
|
+
"@storybook/react-native-theming": "^6.5.7",
|
|
38
38
|
"core-js": "^3.0.1",
|
|
39
39
|
"prop-types": "^15.7.2",
|
|
40
40
|
"simple-markdown": "^0.7.3"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9db04944a3e97f46160ce5ad75df6f0bf4535bd8"
|
|
50
50
|
}
|