You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we do UI binding for validate status, such as error tip showing, invalid highlighting. Most of the time it produces UI like:
If the bound state is composed with child states, which means the child states may have been bound to some child inputs or error tips. It's not necessary to show child states' error at parent level—that will introduce duplication.
Here is an example of FullNameInput, which consists of input for first name & input for last name. If we use error (& hasError) for UI binding, the error of first name (Please input!) will be shown at both child level & parent level:
That's why ownError (& hasOwnError) is needed.
ownError: The state's own error info, regardless of child states.
hasOwnError: If the state contains its own error info.
We will always prefer to use ownError (& hasOwnError) for UI binding. That will help to avoid error duplication.
Previously we provide ownError (& hasOwnError) for FormState (& ArrayFormState) only. While considering a instance of DebouncedState or TransformedState, which wraps a FormState instance, ownError is also needed for it. In the future, we may provide more state types just like DebouncedState & TransformedState, for whom ownError is also needed.
That's why I think we should put it on interface IState.
The text was updated successfully, but these errors were encountered:
When we do UI binding for validate status, such as error tip showing, invalid highlighting. Most of the time it produces UI like:
If the bound state is composed with child states, which means the child states may have been bound to some child inputs or error tips. It's not necessary to show child states' error at parent level—that will introduce duplication.
Here is an example of
FullNameInput
, which consists of input for first name & input for last name. If we useerror
(&hasError
) for UI binding, the error of first name (Please input!
) will be shown at both child level & parent level:That's why
ownError
(&hasOwnError
) is needed.ownError
: The state's own error info, regardless of child states.hasOwnError
: If the state contains its own error info.We will always prefer to use
ownError
(&hasOwnError
) for UI binding. That will help to avoid error duplication.Previously we provide
ownError
(&hasOwnError
) forFormState
(&ArrayFormState
) only. While considering a instance ofDebouncedState
orTransformedState
, which wraps aFormState
instance,ownError
is also needed for it. In the future, we may provide more state types just likeDebouncedState
&TransformedState
, for whomownError
is also needed.That's why I think we should put it on interface
IState
.The text was updated successfully, but these errors were encountered: