Closed gregmsanderson closed 2 months ago
Hi,
As the image shows, it seems there is a type error.
That seems to be due to the presence of [...closeButtonProps} on <CloseButton />. Removing that makes it go away. So its type does not match.
[...closeButtonProps}
<CloseButton />
I can see the toast-region is based on what RAC is doing on https://react-spectrum.adobe.com/react-aria/useToast.html#typescript Sure enough, it's passing that same [...closeButtonProps} prop. I would assume that works because its <Button /> is based on the useButton hook: https://react-spectrum.adobe.com/react-aria/useToast.html#button Rather than the Button component. Or perhaps its because the Button component has been modified and so its types differ ... ? Hmm.
<Button />
(I also wonder whether it should be ToastRegion.tsx to match the other components?)
ToastRegion.tsx
thanks for reporting. The issue is fixed now
Nice. The type fix was more complicated than I thought. Glad I left it to you!
Hi,
As the image shows, it seems there is a type error.
That seems to be due to the presence of
[...closeButtonProps}
on<CloseButton />
. Removing that makes it go away. So its type does not match.I can see the toast-region is based on what RAC is doing on https://react-spectrum.adobe.com/react-aria/useToast.html#typescript Sure enough, it's passing that same
[...closeButtonProps}
prop. I would assume that works because its<Button />
is based on the useButton hook: https://react-spectrum.adobe.com/react-aria/useToast.html#button Rather than the Button component. Or perhaps its because the Button component has been modified and so its types differ ... ? Hmm.(I also wonder whether it should be
ToastRegion.tsx
to match the other components?)