From b138f89e5ab23b72d86aa40eaba0bccb20235874 Mon Sep 17 00:00:00 2001 From: Mark Hein Date: Thu, 10 Oct 2019 15:16:00 -0500 Subject: [PATCH] fix: djsConfig not updating because component is looking at old props --- src/react-dropzone.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/react-dropzone.js b/src/react-dropzone.js index 5c403dc..87febd1 100644 --- a/src/react-dropzone.js +++ b/src/react-dropzone.js @@ -100,14 +100,14 @@ export class DropzoneComponent extends React.Component { * React 'componentWillUpdate' * Update Dropzone options each time the component updates. */ - componentWillUpdate () { + componentWillUpdate (nextProps) { let djsConfigObj let postUrlConfigObj - djsConfigObj = this.props.djsConfig ? this.props.djsConfig : {} + djsConfigObj = nextProps.djsConfig ? nextProps.djsConfig : {} try { - postUrlConfigObj = this.props.config.postUrl ? { url: this.props.config.postUrl } : {} + postUrlConfigObj = nextProps.config.postUrl ? { url: nextProps.config.postUrl } : {} } catch (err) { postUrlConfigObj = {} }