@lumx/react 3.13.0 → 3.13.1
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/index.js +8 -1
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/tabs/TabProvider.tsx +9 -1
package/index.js
CHANGED
|
@@ -12920,7 +12920,14 @@ const TabProvider = props => {
|
|
|
12920
12920
|
if (state === INIT_STATE || !onChange || propState.activeTabIndex === state.activeTabIndex) {
|
|
12921
12921
|
return;
|
|
12922
12922
|
}
|
|
12923
|
-
|
|
12923
|
+
|
|
12924
|
+
// Escape rendering/useEffect context
|
|
12925
|
+
queueMicrotask(() => {
|
|
12926
|
+
// Wait for React to commit last state changes (avoid looping state update)
|
|
12927
|
+
ReactDOM.flushSync(() => {
|
|
12928
|
+
onChange(state.activeTabIndex);
|
|
12929
|
+
});
|
|
12930
|
+
});
|
|
12924
12931
|
},
|
|
12925
12932
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12926
12933
|
[onChange, state.activeTabIndex]);
|