diff --git a/dist/esm/useStackedZIndex.mjs b/dist/esm/useStackedZIndex.mjs
index a78e5c3ef76034648d57483eb7fabd944815e466..4935bcfcdc35c8e7a494a79c6d507aa526672819 100644
--- a/dist/esm/useStackedZIndex.mjs
+++ b/dist/esm/useStackedZIndex.mjs
@@ -1,31 +1,23 @@
-import { useContext, useEffect, useId, useMemo } from "react";
-import { ZIndexHardcodedContext, ZIndexStackContext } from "./context.mjs";
-const ZIndicesByContext = {},
+import { useEffect, useId, useMemo } from "react";
+const CurrentPortalZIndices = {},
   useStackedZIndex = props => {
     const {
         stackZIndex,
-        zIndex: zIndexProp
+        zIndex: zIndexProp = 1e3
       } = props,
       id = useId(),
-      stackingContextLevel = useContext(ZIndexStackContext),
-      hardcoded = useContext(ZIndexHardcodedContext);
-    ZIndicesByContext[stackingContextLevel] ||= {};
-    const stackContext = ZIndicesByContext[stackingContextLevel],
       zIndex = useMemo(() => {
-        if (typeof zIndexProp == "number") return zIndexProp;
         if (stackZIndex) {
-          if (hardcoded) return hardcoded + 1;
-          const highest = Object.values(stackContext).reduce((acc, cur) => Math.max(acc, cur), 0),
-            found = stackingContextLevel * 5e3 + highest + 1;
-          return typeof stackZIndex == "number" ? stackZIndex + found : found;
+          const highest = Object.values(CurrentPortalZIndices).reduce((acc, cur) => Math.max(acc, cur), 0);
+          return typeof stackZIndex == "number" ? Math.max(stackZIndex, highest + 1) : highest + 1;
         }
-        return 1;
-      }, [stackingContextLevel, zIndexProp, stackZIndex]);
+        if (zIndexProp) return zIndexProp;
+      }, [stackZIndex]);
     return useEffect(() => {
-      if (stackZIndex) return stackContext[id] = zIndex, () => {
-        delete stackContext[id];
+      if (typeof stackZIndex == "number") return CurrentPortalZIndices[id] = stackZIndex, () => {
+        delete CurrentPortalZIndices[id];
       };
-    }, [zIndex]), zIndex;
+    }, [stackZIndex]), zIndex;
   };
 export { useStackedZIndex };
 //# sourceMappingURL=useStackedZIndex.mjs.map
diff --git a/dist/esm/useStackedZIndex.mjs.map b/dist/esm/useStackedZIndex.mjs.map
index 655e7d2cc4a905722f7f54eb9bd53c2a2e50a4c2..d41e5caa0cbd0ece2b5e15aa5ab65f178a6e4e57 100644
--- a/dist/esm/useStackedZIndex.mjs.map
+++ b/dist/esm/useStackedZIndex.mjs.map
@@ -1 +1 @@
-{"version":3,"names":["useContext","useEffect","useId","useMemo","ZIndexHardcodedContext","ZIndexStackContext","ZIndicesByContext","useStackedZIndex","props","stackZIndex","zIndex","zIndexProp","id","stackingContextLevel","hardcoded","stackContext","highest","Object","values","reduce","acc","cur","Math","max","found"],"sources":["../../src/useStackedZIndex.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,SAAA,EAAWC,KAAA,EAAOC,OAAA,QAAe;AACtD,SAASC,sBAAA,EAAwBC,kBAAA,QAA0B;AAG3D,MAAMC,iBAAA,GAA4D,CAAC;EAEtDC,gBAAA,GAAoBC,KAAA,IAG3B;IACJ,MAAM;QAAEC,WAAA;QAAaC,MAAA,EAAQC;MAAW,IAAIH,KAAA;MACtCI,EAAA,GAAKV,KAAA,CAAM;MACXW,oBAAA,GAAuBb,UAAA,CAAWK,kBAAkB;MACpDS,SAAA,GAAYd,UAAA,CAAWI,sBAAsB;IAEnDE,iBAAA,CAAkBO,oBAAoB,MAAM,CAAC;IAC7C,MAAME,YAAA,GAAeT,iBAAA,CAAkBO,oBAAoB;MAErDH,MAAA,GAASP,OAAA,CAAQ,MAAM;QAC3B,IAAI,OAAOQ,UAAA,IAAe,UACxB,OAAOA,UAAA;QAET,IAAIF,WAAA,EAAa;UACf,IAAIK,SAAA,EACF,OAAOA,SAAA,GAAY;UAGrB,MAAME,OAAA,GAAUC,MAAA,CAAOC,MAAA,CAAOH,YAAY,EAAEI,MAAA,CAC1C,CAACC,GAAA,EAAKC,GAAA,KAAQC,IAAA,CAAKC,GAAA,CAAIH,GAAA,EAAKC,GAAG,GAC/B,CACF;YAGMG,KAAA,GAAQX,oBAAA,GAAuB,MAAOG,OAAA,GAAU;UAGtD,OAAO,OAAOP,WAAA,IAAgB,WAAWA,WAAA,GAAce,KAAA,GAAQA,KAAA;QACjE;QAEA,OAAO;MACT,GAAG,CAACX,oBAAA,EAAsBF,UAAA,EAAYF,WAAW,CAAC;IAElD,OAAAR,SAAA,CAAU,MAAM;MACd,IAAIQ,WAAA,EACF,OAAAM,YAAA,CAAaH,EAAE,IAAIF,MAAA,EACZ,MAAM;QACX,OAAOK,YAAA,CAAaH,EAAE;MACxB;IAEJ,GAAG,CAACF,MAAM,CAAC,GAEJA,MAAA;EACT","ignoreList":[]}
\ No newline at end of file
+{"version":3,"names":["useEffect","useId","useMemo","CurrentPortalZIndices","useStackedZIndex","props","stackZIndex","zIndex","zIndexProp","id","highest","Object","values","reduce","acc","cur","Math","max"],"sources":["../../src/useStackedZIndex.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,EAAWC,KAAA,EAAOC,OAAA,QAAe;AAE1C,MAAMC,qBAAA,GAAgD,CAAC;EAE1CC,gBAAA,GAAoBC,KAAA,IAG3B;IACJ,MAAM;QAAEC,WAAA;QAAaC,MAAA,EAAQC,UAAA,GAAa;MAAK,IAAIH,KAAA;MAC7CI,EAAA,GAAKR,KAAA,CAAM;MAEXM,MAAA,GAASL,OAAA,CAAQ,MAAM;QAC3B,IAAII,WAAA,EAAa;UACf,MAAMI,OAAA,GAAUC,MAAA,CAAOC,MAAA,CAAOT,qBAAqB,EAAEU,MAAA,CACnD,CAACC,GAAA,EAAKC,GAAA,KAAQC,IAAA,CAAKC,GAAA,CAAIH,GAAA,EAAKC,GAAG,GAC/B,CACF;UACA,OAAI,OAAOT,WAAA,IAAgB,WAClBU,IAAA,CAAKC,GAAA,CAAIX,WAAA,EAAaI,OAAA,GAAU,CAAC,IAGnCA,OAAA,GAAU;QACnB;QACA,IAAIF,UAAA,EACF,OAAOA,UAAA;MAEX,GAAG,CAACF,WAAW,CAAC;IAEhB,OAAAN,SAAA,CAAU,MAAM;MACd,IAAI,OAAOM,WAAA,IAAgB,UACzB,OAAAH,qBAAA,CAAsBM,EAAE,IAAIH,WAAA,EACrB,MAAM;QACX,OAAOH,qBAAA,CAAsBM,EAAE;MACjC;IAEJ,GAAG,CAACH,WAAW,CAAC,GAETC,MAAA;EACT","ignoreList":[]}
