imagekit-developer/imagekit-react

IKUpload component passes invalid properties to the DOM input element

Closed this issue · 1 comments

let {
publicKey,
urlEndpoint,
authenticationEndpoint,
fileName,
useUniqueFileName,
tags,
folder,
isPrivateFile,
customCoordinates,
responseFields,
onError,
onSuccess,
onUploadStart,
onUploadProgress,
inputRef,
validateFile,
...restProps
} = this.props;
return (
<input
{...restProps}

The assignment that creates the restProps variable is missing the following props that are defined on the IKUpload component:

      webhookUrl,
      overwriteFile,
      overwriteAITags,
      overwriteTags,
      overwriteCustomMetadata,

This throws multiple error in the browser when those props are used. e.g.

[Error] Warning: React does not recognize the webhookUrl prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase webhookurl instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Version 3.0.0 released with a fix for this. Please read the breaking change before upgrading.