react-file-drop icon indicating copy to clipboard operation
react-file-drop copied to clipboard

Resolve prop validate warning for frame prop in SSR apps by matching prop-types with ts types

Open labithiotis opened this issue 1 year ago • 2 comments

For SSR apps I would see a console warning about the frame prop being null, but according to TS types frame can undefined and for SSR it's expected to be undefined. Therefore this PR just updates the prop-type validation to be optional and checks prop is an instance of an element.

The error I was seeing:

Warning: Failed prop type: Warning: Required prop `frame` was not specified in `FileDrop`
    at FileDrop (/node_modules/.pnpm/[email protected]/node_modules/react-file-drop/FileDrop.js:24:24)
    at SideUploadButton (./UploadButton.tsx:16:46)
    at div
    at div
    at Side (./Side.tsx:35:17)
    at div

labithiotis avatar Apr 07 '24 08:04 labithiotis

@sarink Hope you're well, I am just checking if you saw this PR or if there's someone else I should nudge to get it reviewed.

labithiotis avatar Apr 15 '24 13:04 labithiotis

@sarink Is there any way I can help to get this merged? Otherwise, I will fork and deploy my own library

labithiotis avatar May 30 '24 11:05 labithiotis