@tramvai/module-router 5.4.3 → 5.5.2

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.
@@ -1,5 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Fragment } from 'react';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
2
  import { CHILD_APP_PAGE_SERVICE_TOKEN } from '@tramvai/tokens-child-app';
4
3
  import { useRoute } from '@tinkoff/router';
5
4
 
@@ -9,8 +8,13 @@ const ChildAppRenderChildren = ({ di, ...props }) => {
9
8
  token: CHILD_APP_PAGE_SERVICE_TOKEN,
10
9
  optional: true,
11
10
  });
12
- const PageComponent = (childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent()) || Fragment;
13
- return jsx(PageComponent, { ...props });
11
+ const PageComponent = childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent();
12
+ if (PageComponent) {
13
+ return jsx(PageComponent, { ...props });
14
+ }
15
+ // Only `children` and `key` are allowed as props for Fragment
16
+ return jsx(Fragment, { children: props.children });
14
17
  };
18
+ ChildAppRenderChildren.displayName = 'ChildAppChildren';
15
19
 
16
20
  export { ChildAppRenderChildren };
@@ -1,5 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { Fragment } from 'react';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
2
  import { CHILD_APP_PAGE_SERVICE_TOKEN } from '@tramvai/tokens-child-app';
4
3
  import { useRoute } from '@tinkoff/router';
5
4
 
@@ -9,8 +8,13 @@ const ChildAppRenderChildren = ({ di, ...props }) => {
9
8
  token: CHILD_APP_PAGE_SERVICE_TOKEN,
10
9
  optional: true,
11
10
  });
12
- const PageComponent = (childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent()) || Fragment;
13
- return jsx(PageComponent, { ...props });
11
+ const PageComponent = childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent();
12
+ if (PageComponent) {
13
+ return jsx(PageComponent, { ...props });
14
+ }
15
+ // Only `children` and `key` are allowed as props for Fragment
16
+ return jsx(Fragment, { children: props.children });
14
17
  };
18
+ ChildAppRenderChildren.displayName = 'ChildAppChildren';
15
19
 
16
20
  export { ChildAppRenderChildren };
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
7
6
  var tokensChildApp = require('@tramvai/tokens-child-app');
8
7
  var router = require('@tinkoff/router');
9
8
 
@@ -13,8 +12,13 @@ const ChildAppRenderChildren = ({ di, ...props }) => {
13
12
  token: tokensChildApp.CHILD_APP_PAGE_SERVICE_TOKEN,
14
13
  optional: true,
15
14
  });
16
- const PageComponent = (childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent()) || react.Fragment;
17
- return jsxRuntime.jsx(PageComponent, { ...props });
15
+ const PageComponent = childAppPageService === null || childAppPageService === void 0 ? void 0 : childAppPageService.getComponent();
16
+ if (PageComponent) {
17
+ return jsxRuntime.jsx(PageComponent, { ...props });
18
+ }
19
+ // Only `children` and `key` are allowed as props for Fragment
20
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
18
21
  };
22
+ ChildAppRenderChildren.displayName = 'ChildAppChildren';
19
23
 
20
24
  exports.ChildAppRenderChildren = ChildAppRenderChildren;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-router",
3
- "version": "5.4.3",
3
+ "version": "5.5.2",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "browser": {
@@ -26,27 +26,27 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@tinkoff/errors": "0.6.2",
29
- "@tinkoff/router": "0.5.11",
29
+ "@tinkoff/router": "0.5.14",
30
30
  "@tinkoff/url": "0.11.2",
31
- "@tramvai/react": "5.4.3",
32
- "@tramvai/safe-strings": "0.8.2",
33
- "@tramvai/tokens-child-app": "5.4.3",
34
- "@tramvai/tokens-render": "5.4.3",
35
- "@tramvai/tokens-router": "5.4.3",
36
- "@tramvai/tokens-server": "5.4.3",
37
- "@tramvai/experiments": "5.4.3"
31
+ "@tramvai/react": "5.5.2",
32
+ "@tramvai/safe-strings": "0.8.3",
33
+ "@tramvai/tokens-child-app": "5.5.2",
34
+ "@tramvai/tokens-render": "5.5.2",
35
+ "@tramvai/tokens-router": "5.5.2",
36
+ "@tramvai/tokens-server": "5.5.2",
37
+ "@tramvai/experiments": "5.5.2"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@tinkoff/utils": "^2.1.2",
41
- "@tramvai/cli": "5.4.3",
42
- "@tramvai/core": "5.4.3",
43
- "@tramvai/module-log": "5.4.3",
44
- "@tramvai/module-server": "5.4.3",
45
- "@tramvai/papi": "5.4.3",
46
- "@tramvai/state": "5.4.3",
47
- "@tramvai/test-helpers": "5.4.3",
48
- "@tramvai/test-mocks": "5.4.3",
49
- "@tramvai/tokens-common": "5.4.3",
41
+ "@tramvai/cli": "5.5.2",
42
+ "@tramvai/core": "5.5.2",
43
+ "@tramvai/module-log": "5.5.2",
44
+ "@tramvai/module-server": "5.5.2",
45
+ "@tramvai/papi": "5.5.2",
46
+ "@tramvai/state": "5.5.2",
47
+ "@tramvai/test-helpers": "5.5.2",
48
+ "@tramvai/test-mocks": "5.5.2",
49
+ "@tramvai/tokens-common": "5.5.2",
50
50
  "@tinkoff/dippy": "0.11.3",
51
51
  "react": "*",
52
52
  "tslib": "^2.4.0"