Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
19
node_modules/next/dist/esm/client/portal/index.js
generated
vendored
Normal file
19
node_modules/next/dist/esm/client/portal/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
export const Portal = (param)=>{
|
||||
let { children, type } = param;
|
||||
const [portalNode, setPortalNode] = useState(null);
|
||||
useEffect(()=>{
|
||||
const element = document.createElement(type);
|
||||
document.body.appendChild(element);
|
||||
setPortalNode(element);
|
||||
return ()=>{
|
||||
document.body.removeChild(element);
|
||||
};
|
||||
}, [
|
||||
type
|
||||
]);
|
||||
return portalNode ? /*#__PURE__*/ createPortal(children, portalNode) : null;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue