@etsoo/toolpad 1.0.25 → 1.0.26

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.
@@ -114,8 +114,6 @@ function PageContainer(props) {
114
114
  loaded.current = true;
115
115
  }
116
116
  }, [activePage?.sourcePath]);
117
- // Cache the children to avoid re-rendering when the page changes
118
- const childrenResult = React.useMemo(() => children, [activePage?.sourcePath]);
119
117
  let resolvedBreadcrumbs = state.breadcrumbs ?? activePage?.breadcrumbs ?? [];
120
118
  const title = state.title ?? defaultTitle ?? activePage?.title ?? "";
121
119
  if (state.page) {
@@ -135,5 +133,5 @@ function PageContainer(props) {
135
133
  ? resolvedBreadcrumbs.map((item, index) => {
136
134
  return index < resolvedBreadcrumbs.length - 1 ? ((0, jsx_runtime_1.jsx)(Link_1.default, { component: Link_2.Link, underline: "hover", color: "inherit", href: item.path, children: (0, navigation_1.getItemTitle)(item) }, item.path)) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { color: "text.primary", children: (0, navigation_1.getItemTitle)(item) }, item.path));
137
135
  })
138
- : null })), (0, jsx_runtime_1.jsxs)(PageContentHeader, { children: [title ? (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h4", children: title }) : null, (0, jsx_runtime_1.jsx)(ToolbarComponent, { ...toolbarSlotProps })] })] })), childrenResult] }));
136
+ : null })), (0, jsx_runtime_1.jsxs)(PageContentHeader, { children: [title ? (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h4", children: title }) : null, (0, jsx_runtime_1.jsx)(ToolbarComponent, { ...toolbarSlotProps })] })] })), children] }));
139
137
  }
@@ -73,8 +73,6 @@ function PageContainer(props) {
73
73
  loaded.current = true;
74
74
  }
75
75
  }, [activePage?.sourcePath]);
76
- // Cache the children to avoid re-rendering when the page changes
77
- const childrenResult = React.useMemo(() => children, [activePage?.sourcePath]);
78
76
  let resolvedBreadcrumbs = state.breadcrumbs ?? activePage?.breadcrumbs ?? [];
79
77
  const title = state.title ?? defaultTitle ?? activePage?.title ?? "";
80
78
  if (state.page) {
@@ -94,6 +92,6 @@ function PageContainer(props) {
94
92
  ? resolvedBreadcrumbs.map((item, index) => {
95
93
  return index < resolvedBreadcrumbs.length - 1 ? (_jsx(Link, { component: ToolpadLink, underline: "hover", color: "inherit", href: item.path, children: getItemTitle(item) }, item.path)) : (_jsx(Typography, { color: "text.primary", children: getItemTitle(item) }, item.path));
96
94
  })
97
- : null })), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] })), childrenResult] }));
95
+ : null })), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] })), children] }));
98
96
  }
99
97
  export { PageContainer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/toolpad",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "author": "ETSOO",
5
5
  "description": "Dashboard framework extention based on Toolpad Core",
6
6
  "main": "build/cjs/index.js",
@@ -143,12 +143,6 @@ function PageContainer(props: PageContainerProps) {
143
143
  }
144
144
  }, [activePage?.sourcePath]);
145
145
 
146
- // Cache the children to avoid re-rendering when the page changes
147
- const childrenResult = React.useMemo(
148
- () => children,
149
- [activePage?.sourcePath]
150
- );
151
-
152
146
  let resolvedBreadcrumbs = state.breadcrumbs ?? activePage?.breadcrumbs ?? [];
153
147
  const title = state.title ?? defaultTitle ?? activePage?.title ?? "";
154
148
 
@@ -200,7 +194,7 @@ function PageContainer(props: PageContainerProps) {
200
194
  </PageContentHeader>
201
195
  </Stack>
202
196
  )}
203
- {childrenResult}
197
+ {children}
204
198
  </Stack>
205
199
  );
206
200
  }