import { jsx } from 'react/jsx-runtime';
import { createContext, useState, useEffect } from 'react';

const PortalProviderContext = createContext(
  {}
);

const PortalProvider = (props) => {
  const { root: rootProp, children } = props;
  const [root, setRoot] = useState(rootProp);
  useEffect(() => {
    setRoot(rootProp);
  }, [rootProp]);
  return /* @__PURE__ */ jsx(PortalProviderContext.Provider, { value: { root }, children });
};

export { PortalProvider as P, PortalProviderContext as a };
//# sourceMappingURL=PortalProvider-Cj_y3gbC.js.map
