zaichaopan / react-aria-components-tailwind-starter

Tailwind react aria components starter kits
https://zaichaopan.github.io/react-aria-components-tailwind-starter
MIT License
29 stars 4 forks source link

Type error in toast-region.tsx #10

Closed gregmsanderson closed 2 months ago

gregmsanderson commented 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.

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?)

type-error

zaichaopan commented 2 months ago

thanks for reporting. The issue is fixed now

gregmsanderson commented 2 months ago

Nice. The type fix was more complicated than I thought. Glad I left it to you!