primitives
primitives copied to clipboard
Can't import type PointerDownOutsideEvent
This type seems needed for onPointerDownOutside
methods, but it is not exported in
@radix-ui/react-dismissable-layer/dist/index.d.ts
"@radix-ui/react-dismissable-layer": "1.0.4"
I solved it by creating my own type just as it was created in the file above...
You can type onPointerDownOutside
like
type ContentProps = React.ComponentProps<typeof SomeContentPrimitive>
type Props = {
onPointerDownOutside: ContentProps['onPointerDownOutside']
}
This worked for me:
type PointerDownOutsideEvent = CustomEvent<{ originalEvent: PointerEvent; }>;
We don't need to export the specific event type as it shouldn't be needed. If you are rewrapping the component, @joaom00's solution is what we would recommend.