react-spectrum
react-spectrum copied to clipboard
chore: suggested improvements for useDialog types
Suggestion for https://github.com/adobe/react-spectrum/discussions/1618#discussioncomment-396010
Would this be a possibiliy to keep the wide types, while still offering a possibility to make them narrower? It also "solves" the issue when HTMLElement
being incompatible when react-aria
has different @types/react
than the application.
📝 Test Instructions:
const Test = (props: { onClose: () => void, isDismissable: boolean, id: string }) => {
const ref = useRef()
const { dialogProps, titleProps } = useDialog<HTMLDivElement, HTMLHeadElement>(props, ref);
// sets it as a more specific element
// however useDialog(props, ref) also keeps working
return (
<div { ...dialogProps } > <h4>Keker < /h4>{props.children}</div >
)
}
🧢 Your Project:
Private repository