alex-cory / react-useportal

🌀 React hook for Portals
MIT License
891 stars 34 forks source link

export UsePortalOptions allowing extension #61

Closed twelch closed 3 years ago

twelch commented 3 years ago

I found that if I wanted to implement a useDropdown in Typescript by building on usePortal, I needed the props interface exported in order to build on it. Please consider accepting, thanks.

For example:

import usePortal, { UsePortalOptions } from "./usePortal";

type DropdownOptions = UsePortalOptions & {
  width: number;
  height?: number;
};

const useDropdown = ({ width, height, onOpen, ...config }: DropdownOptions) => {
  ...
}
alex-cory commented 3 years ago

avaiable in v1.0.14