UNPKG

@winglet/react-utils

Version:

React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality

10 lines (7 loc) 314 B
import { jsx } from 'react/jsx-runtime'; import { memo } from 'react'; import { PortalContextProvider } from './context/PortalContextProvider.mjs'; const withPortal = (Component) => { return memo((props) => (jsx(PortalContextProvider, { children: jsx(Component, { ...props }) }))); }; export { withPortal };