From 49c752f218ff79a4159b2df5622a79f5b9a2fc78 Mon Sep 17 00:00:00 2001 From: Adam Royle Date: Fri, 20 Jan 2017 11:08:05 +1000 Subject: [PATCH 1/3] Only spread props that we are not using in this component (and super component). --- src/Fieldset.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Fieldset.js b/src/Fieldset.js index deab318..f23af26 100644 --- a/src/Fieldset.js +++ b/src/Fieldset.js @@ -19,6 +19,7 @@ export default class Fieldset extends Component { render() { let {Root} = this.props.stylesheet || this.constructor.stylesheet; - return ; + let {stylesheet, formValue, select, selectFormValue, ...props} = this.props + return ; } } From c8b92a98fbf4af28b715421e7456d45027ac9fd9 Mon Sep 17 00:00:00 2001 From: Adam Royle Date: Fri, 20 Jan 2017 12:24:36 +1000 Subject: [PATCH 2/3] Prevent React 15.4 warning about uncontrolled -> controlled inputs. --- src/Input.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Input.js b/src/Input.js index 1297395..d69de28 100644 --- a/src/Input.js +++ b/src/Input.js @@ -39,6 +39,9 @@ export default class Input extends React.Component { if (debounceEnabled) { value = this.state.value; } + if (Component === 'input' && (value === undefined || value === null)) { + value = ''; + } return ( Date: Fri, 20 Jan 2017 12:25:23 +1000 Subject: [PATCH 3/3] Prevent React 15.4 warning about spreading unknown props on dom elements. --- src/ErrorList.js | 4 ++-- src/Fieldset.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ErrorList.js b/src/ErrorList.js index 662db34..8628a1c 100644 --- a/src/ErrorList.js +++ b/src/ErrorList.js @@ -40,8 +40,8 @@ export default class ErrorList extends Component { }); render() { - let { - noLabel, hideNonForced, complete, schemaType, stylesheet, + // eslint-disable-next-line no-unused-vars + let { noLabel, hideNonForced, complete, schemaType, stylesheet, formValue, select, label, ...props } = this.props; let {Root, Error} = stylesheet || this.constructor.stylesheet; diff --git a/src/Fieldset.js b/src/Fieldset.js index f23af26..bb317ee 100644 --- a/src/Fieldset.js +++ b/src/Fieldset.js @@ -19,7 +19,8 @@ export default class Fieldset extends Component { render() { let {Root} = this.props.stylesheet || this.constructor.stylesheet; - let {stylesheet, formValue, select, selectFormValue, ...props} = this.props + // eslint-disable-next-line no-unused-vars + let {stylesheet, formValue, select, selectFormValue, ...props} = this.props; return ; } }