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.
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 asthis.childRef
when the component renders. Otherwise, we could ditch this altogether and encourage use ofthis.props.setValidations
. But its a little bit different.