Open dklymenk opened 10 months ago
Name | Link |
---|---|
Latest commit | ee1d0dd783ba670049a781035aa1ca5b3be72838 |
Latest deploy log | https://app.netlify.com/sites/evergreen-storybook/deploys/64ff8cd1e9517d0009d48d67 |
Deploy Preview | https://deploy-preview-1664--evergreen-storybook.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Overview
Popover
supports aref
prop that doesn't seem to be documented or typed.Here is a codesandbox that showcases the ref actually working at run time, but with type errors. This PR addresses those errors by:
PopoverRef
type that has the signatures foropen
andclose
methodsref
prop toPopoverProps
I also tweaked the definition for
childred
prop. Specifically, thegetRef
prop passed to children to use the newPopoverRef
instead of the genericHTMLElement
.Since the type definition for select menu relies on
PopoverProps
, I added theref
to the list of omitted properties as that component doesn't actually have any ref-related functionality.The changes can be tested by trying to pass a ref created by
useRef<PopoverRef>
and making sure there are no type errors related to callingopen
orclose
.Documentation