christianalfoni / formsy-react

A form input builder and validator for React JS
MIT License
2.6k stars 438 forks source link

Fixes custom validation inside form element #474

Closed track0x1 closed 6 years ago

track0x1 commented 6 years ago

Adding a ref and passing it down the chain seemed like the best option here. Couldn't use a static that would be hoisted because we wouldn't be able to use instance variables. The only tradeoff is that it requires innerRef to be a string so it is strapped to the instance as this.childRef when the component renders. Otherwise, we could ditch this altogether and encourage use of this.props.setValidations. But its a little bit different.

track0x1 commented 6 years ago

Closing because was removed in #473