jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
283 stars 38 forks source link

Doesn't work with PureRenderMixin #44

Closed idolize closed 8 years ago

idolize commented 8 years ago

By storing the validation messages an an Object, this library unfortunately does not work with a simple PureRenderMixin version of shouldComponentUpdate (which just does a === check over all the props and state), because even though the props.errors object has changed, the reference equality check does not reflect that.

It would be great if the props.errors could change reference equality when the errors change (using something like ImmutableJs––as Facebook suggests––or even just by using the ES6 spread operator (ex: this.setState({ errors: { ...nextErrors } }) instead of this.setState({ errors: nextErrors })

jurassix commented 8 years ago

fixed and published in v5.2.1

idolize commented 8 years ago

Awesome thanks :+1: