react-loose-forms
Advanced tools
Comparing version 2.1.0 to 2.1.1
var is = require('is'); | ||
var clone = require('clone'); | ||
var xtend = require('xtend'); | ||
var InputTypes = require('./InputTypes'); | ||
@@ -50,6 +51,7 @@ | ||
var should_validate = this.state.submit_attempts > 0; | ||
// Don't mutate the state data directly | ||
var data = clone(this.state.data); | ||
data[field_name] = new_value; | ||
//merge in the new value without mutating this.state.data | ||
var o = {}; | ||
o[field_name] = new_value; | ||
var data = xtend(this.state.data, o); | ||
@@ -56,0 +58,0 @@ this.setState({ |
{ | ||
"name": "react-loose-forms", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A form library for React that flexible and dynamic allowing it to be effective in many (if not all) situations where you need to collect user input.", | ||
@@ -29,4 +29,5 @@ "main": "index.js", | ||
"clone": "^1.0.2", | ||
"is": "^3.0.1" | ||
"is": "^3.0.1", | ||
"xtend": "^4.0.1" | ||
} | ||
} |
13113
159
3
+ Addedxtend@^4.0.1
+ Addedxtend@4.0.2(transitive)