bytescale / bytescale-upload-widget-react

Beautiful File Upload Component | Developed for React by Bytescale
https://www.bytescale.com/docs/upload-widget/react
MIT License
73 stars 2 forks source link

UploadButton options type error #12

Closed kincaidoneil closed 11 months ago

kincaidoneil commented 11 months ago

apiKey isn't allowed on the options prop passed to UploadButton:

Type '{ apiKey: string; }' is not assignable to type 'UploadWidgetReactConfig'.
  Object literal may only specify known properties, and 'apiKey' does not exist in type 'UploadWidgetReactConfig'.

The expected type comes from property 'options' which is declared here on type 'IntrinsicAttributes & UploadButtonProps'

Simple reproduction, React/Vite/TypeScript@5.3

Other options work fine. I believe it has to do with how it's linking to the @bytescale/sdk types.

ljwagerfield commented 11 months ago

Thank you for the reproduction! 🎉

Fixed in @bytescale/upload-widget-react@^4.13.0 👍

Simple reproduction (fixed)

(There were some bad import statements affecting the links to the @bytescale/sdk types (as you highlighted).)