Skip to content

Commit

Permalink
Fix react 15 console warning: 'value' prop on forms should not be nul…
Browse files Browse the repository at this point in the history
…l (#15)

* Fix react 15 console warning: 'value' prop on forms should not be null

the value in redux store shouldn't be affected.
caused by small breaking change in react 15: facebook/react#5864

* disable eslint complexity
  • Loading branch information
budiantotan authored and fawwaz committed May 31, 2018
1 parent 64e6632 commit 4e265be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createField.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import withForm from './withForm';
import _createField from './_createField';

/* eslint-disable complexity */
const mapStateToProps = (state, props) => {
const formId = props.form.getFormId();
const fieldNames = getFieldNames(props.name);
Expand All @@ -33,9 +34,10 @@ const mapStateToProps = (state, props) => {
isFieldEnabled: field.isEnabled,
isValidating: field.isValidating,
touched: field.touched,
value: field.value,
value: field.value || '',
};
};
/* eslint-enable complexity */

const mapDispatchToProps = (dispatch, props) => ({
mergeFields: fieldNames => object => {
Expand Down

0 comments on commit 4e265be

Please sign in to comment.