Rocky_Mountain_Vending/.pnpm-store/v10/files/34/4cd2fdc7487f929831eabacd08fc995646b1c8feb2741caaabac6334fe91f95059423e499d382a748977de0129cac42fbe1cfba0276bb7acf78301925761f9
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

18 lines
No EOL
567 B
Text

import { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
export const Portal = ({ children, type })=>{
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