@tramvai/react 2.133.4 → 2.134.0

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.
Files changed (2) hide show
  1. package/README.md +19 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -112,3 +112,22 @@ const LazyComponent = lazy(() => import('./components/foo'), {
112
112
 
113
113
  <LazyComponent />;
114
114
  ```
115
+
116
+ ### Handling chunk loading errors
117
+
118
+ We suggest to use `@loadable` [approach](https://loadable-components.com/docs/error-boundaries/), which assumes, that you must wrap lazy components in ErrorBoundary:
119
+
120
+ ```tsx
121
+ import { lazy, UniversalErrorBoundary } from '@tramvai/react';
122
+
123
+ const Component = lazy(() => import('./Component'));
124
+
125
+ const ComponentWrapper = () => {
126
+ return (
127
+ // feel free to use your own implementation
128
+ <UniversalErrorBoundary error={null} fallback={() => null}>
129
+ <Notifications />
130
+ </UniversalErrorBoundary>
131
+ );
132
+ };
133
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/react",
3
- "version": "2.133.4",
3
+ "version": "2.134.0",
4
4
  "description": "",
5
5
  "main": "lib/react.js",
6
6
  "typings": "lib/react.d.ts",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@loadable/component": "^5.15.2",
21
21
  "@types/loadable__component": "^5.13.4",
22
- "@tramvai/types-actions-state-context": "2.133.4",
22
+ "@tramvai/types-actions-state-context": "2.134.0",
23
23
  "hoist-non-react-statics": "^3.3.0"
24
24
  },
25
25
  "peerDependencies": {