Skip to content

Validator rules #1145

Answered by splashdust
patriklarssson asked this question in Q&A
Discussion options

You must be logged in to vote

I think they were meant to be used together with <FormItems> and FormContext, but it is a bit unclear what the original idea was here. Most of that stuff was contributed to the library early on, and seem to be half-finished and is lacking any documentation.

I'd avoid using the FormContext stuff, as it is likely that it will need substantial refactoring to be usable and maintainable. We'll probably need to rethink it anyway as we migrate the underlying implementation over to web components in Green Core.

In the meantime, the validator object itself can be used on its own to control rendering of error/success messages for the fields, for example:

<TextInput
    label={'Label'}
    info={

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by splashdust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Documentation Changes only affect the documentation
2 participants
Converted from issue

This discussion was converted from issue #1131 on December 04, 2023 17:08.