@algorithm-shift/design-system 1.2.67 → 1.2.68
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/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -243,11 +243,13 @@ function TabGroupComponent({
|
|
|
243
243
|
activeTab,
|
|
244
244
|
onTabChange
|
|
245
245
|
}) {
|
|
246
|
+
const [mounted, setMounted] = (0, import_react3.useState)(false);
|
|
246
247
|
(0, import_react3.useEffect)(() => {
|
|
247
|
-
if (list && list.length > 0 && !activeTab && onTabChange) {
|
|
248
|
+
if (list && list.length > 0 && !activeTab && onTabChange && !mounted) {
|
|
248
249
|
onTabChange(list[0]?.tabId);
|
|
250
|
+
setMounted(true);
|
|
249
251
|
}
|
|
250
|
-
}, [list, activeTab, onTabChange]);
|
|
252
|
+
}, [list, activeTab, onTabChange, mounted]);
|
|
251
253
|
const formatedList = (0, import_react3.useMemo)(
|
|
252
254
|
() => Array.isArray(list) ? [...list].sort((a, b) => (a.orderNumber ?? 0) - (b.orderNumber ?? 0)) : [],
|
|
253
255
|
[list]
|