The Flow UI framework supports validating components, before sending the metadata to Flow for more complex validation. This can be useful for reducing latency on mobile devices, bandwidth constrained clients, or if we want to implement custom validation, say, an input that accepts a certain format.
We can override the default validation rules in a custom component by calling:
1 |
manywho.state.setComponent('<component Id>', { isValid: false, validationMessage: 'custom message' }, this.props.flowKey) |
To set a component as valid:
1 |
manywho.state.setComponent('<component Id>', { isValid: true }, this.props.flowKey) |
Also see:
- Creating a custom component
- Overriding a default component
- Custom style for components
- The three states of custom components
- Components: Client side validation
- Enabling client side validation