- Use ComponentDidMount and context to attach to container - On every render, all attached components evaluate their own validation state, and call setState on the corresponding Form property
Const ArbitraryComponent = component(() => ); class Input extends ReactComponent { componentDidMount () { const meRef = Symbol(); this.context.validationState[meRef] = { valid: true, messages: [] }; } componentWillReceiveProps (nextProps) { const validationResult = this.validate(nextProps); if (this.context.validationState[meRef] !== validationResult) { this.context.update(validationResult, meRef); } } }