create project
This commit is contained in:
7
kitabcitab/node_modules/next/dist/client/portal/index.d.ts
generated
vendored
Normal file
7
kitabcitab/node_modules/next/dist/client/portal/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference types="react" />
|
||||
declare type PortalProps = {
|
||||
children: React.ReactNode;
|
||||
type: string;
|
||||
};
|
||||
export declare const Portal: ({ children, type }: PortalProps) => import("react").ReactPortal | null;
|
||||
export {};
|
||||
30
kitabcitab/node_modules/next/dist/client/portal/index.js
generated
vendored
Normal file
30
kitabcitab/node_modules/next/dist/client/portal/index.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Portal = void 0;
|
||||
var _react = require("react");
|
||||
var _reactDom = require("react-dom");
|
||||
const Portal = ({ children , type })=>{
|
||||
const [portalNode, setPortalNode] = (0, _react).useState(null);
|
||||
(0, _react).useEffect(()=>{
|
||||
const element = document.createElement(type);
|
||||
document.body.appendChild(element);
|
||||
setPortalNode(element);
|
||||
return ()=>{
|
||||
document.body.removeChild(element);
|
||||
};
|
||||
}, [
|
||||
type
|
||||
]);
|
||||
return portalNode ? /*#__PURE__*/ (0, _reactDom).createPortal(children, portalNode) : null;
|
||||
};
|
||||
exports.Portal = Portal;
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
kitabcitab/node_modules/next/dist/client/portal/index.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/client/portal/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../client/portal/index.tsx"],"names":["Portal","children","type","portalNode","setPortalNode","useState","useEffect","element","document","createElement","body","appendChild","removeChild","createPortal"],"mappings":"AAAA;;;;;AAAoC,IAAA,MAAO,WAAP,OAAO,CAAA;AACd,IAAA,SAAW,WAAX,WAAW,CAAA;AAOjC,MAAMA,MAAM,GAAG,CAAC,EAAEC,QAAQ,CAAA,EAAEC,IAAI,CAAA,EAAe,GAAK;IACzD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGC,CAAAA,GAAAA,MAAQ,AAA0B,CAAA,SAA1B,CAAqB,IAAI,CAAC;IAEtEC,CAAAA,GAAAA,MAAS,AAOC,CAAA,UAPD,CAAC,IAAM;QACd,MAAMC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CAACP,IAAI,CAAC;QAC5CM,QAAQ,CAACE,IAAI,CAACC,WAAW,CAACJ,OAAO,CAAC;QAClCH,aAAa,CAACG,OAAO,CAAC;QACtB,OAAO,IAAM;YACXC,QAAQ,CAACE,IAAI,CAACE,WAAW,CAACL,OAAO,CAAC;SACnC,CAAA;KACF,EAAE;QAACL,IAAI;KAAC,CAAC;IAEV,OAAOC,UAAU,iBAAGU,CAAAA,GAAAA,SAAY,AAAsB,CAAA,aAAtB,CAACZ,QAAQ,EAAEE,UAAU,CAAC,GAAG,IAAI,CAAA;CAC9D;QAbYH,MAAM,GAANA,MAAM"}
|
||||
Reference in New Issue
Block a user