Comparing version 0.0.32 to 0.0.33
@@ -288,3 +288,3 @@ 'use strict'; | ||
value: function componentDidUpdate(prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props); | ||
@@ -339,3 +339,3 @@ } | ||
value: function componentDidUpdate(prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props); | ||
@@ -394,3 +394,3 @@ } | ||
value: function componentDidUpdate(prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props); | ||
@@ -397,0 +397,0 @@ } |
@@ -60,3 +60,4 @@ import React from 'react' | ||
yesOrNo: 'yes', | ||
username: 'john' | ||
username: 'john', | ||
usernameValidation: validations.username | ||
} | ||
@@ -66,3 +67,10 @@ | ||
this.setState({ | ||
yesOrNo: 'no' | ||
yesOrNo: 'no', | ||
usernameValidation: [ | ||
{ | ||
rule: 'isLength', | ||
args: { min: 5, max: 40 }, | ||
invalidFeedback: 'please provide a username (min: 5, max: 40)' | ||
} | ||
] | ||
}) | ||
@@ -85,2 +93,3 @@ } | ||
console.log(res.formItems) | ||
console.log(this.state) | ||
} | ||
@@ -118,3 +127,3 @@ | ||
validFormBeforePost={this.validFormBeforePost} | ||
invalidFormBeforePost={this.invalidFormBeforePost} | ||
invalidFormBeforePost={this.invalidFormBeforePost.bind(this)} | ||
validFormAfterPost={this.validFormAfterPost} | ||
@@ -142,3 +151,3 @@ invalidFormAfterPost={this.invalidFormAfterPost} | ||
onChange={this.handleInput.bind(this)} | ||
validations={validations.username} /> | ||
validations={this.state.usernameValidation} /> | ||
</div> | ||
@@ -145,0 +154,0 @@ |
{ | ||
"name": "recassfov", | ||
"version": "0.0.32", | ||
"version": "0.0.33", | ||
"description": "React client and server side form validation", | ||
@@ -5,0 +5,0 @@ "main": "./build/Recassfov.js", |
@@ -245,3 +245,3 @@ import React from 'react' | ||
componentDidUpdate (prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props) | ||
@@ -276,3 +276,3 @@ } | ||
componentDidUpdate (prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props) | ||
@@ -309,3 +309,3 @@ } | ||
componentDidUpdate (prevProps) { | ||
if (this.props.value !== prevProps.value) { | ||
if (this.props.value !== prevProps.value || this.props.validations !== prevProps.validations) { | ||
this.props.store.setFormItem(this.props) | ||
@@ -312,0 +312,0 @@ } |
176648
906