Prevent multiple rendering with PureRenderMixin
Creating a new instance of error triggers two additional rendering when typing in an input, using same instance prevent it to happen.
This commit is contained in:
parent
300a53f172
commit
6bcdb61b27
|
|
@ -7,6 +7,7 @@ var Mixin = require('./Mixin.js');
|
|||
var HOC = require('./HOC.js');
|
||||
var Decorator = require('./Decorator.js');
|
||||
var options = {};
|
||||
var emptyArray = [];
|
||||
|
||||
Formsy.Mixin = Mixin;
|
||||
Formsy.HOC = HOC;
|
||||
|
|
@ -277,7 +278,7 @@ Formsy.Form = React.createClass({
|
|||
error: (function () {
|
||||
|
||||
if (isValid && !isRequired) {
|
||||
return [];
|
||||
return emptyArray;
|
||||
}
|
||||
|
||||
if (validationResults.errors.length) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue