Skip to content

Commit 735f709

Browse files
authored
fix onContextReady error.
When `onContextReady` prop is not provided, the first render was throwing `Uncaught TypeError: onContextReady is not a function`.
1 parent 8bd8216 commit 735f709

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FileUpload.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function FileUpload(props) {
329329

330330
if (onFilesChange) {
331331
onFilesChange(getBase64 ? files : originalFiles)
332-
onContextReady(getContext())
332+
if (onContextReady) onContextReady(getContext())
333333
}
334334
// eslint-disable-next-line
335335
}, [files, action])

0 commit comments

Comments
 (0)