-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(forms): Add a FormRecord
type.
#45607
Conversation
sorry for probably a lot of oversimplifications ps. I saw that it is supposed to be open ended so mayby more like |
@criskrzysiu
There is very little difference -- the types are a bit more permissive around removing and adding controls, in a way that's difficult to implement if everything just used
We must extend FormGroup because there are some backwards-compatibility warts around
By having a separate type, we can relax some of the constraints. e.g. |
Thank You for the explanation
But still as it is not super simple could I ask for a nice example for when to use |
@criskrzysiu
Always use |
As part of the typed forms RFC, we proposed the creation of a new FormRecord type, to support dynamic groups with homogenous values. This PR introduces FormRecord, as a subclass of FormGroup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed-for: public-api
This PR was merged into the repository by commit e0a2248. |
Unless the form group record type is not string but say an enum I believe... Am I correct? |
Yes, exacly what I mentioned before when we want something else than string
as control names
W dniu czw., 21.04.2022 o 14:08 Harpush ***@***.***>
napisał(a):
… @criskrzysiu <https://github.com/criskrzysiu>
could I ask for a nice example for when to use
FormGroup<Partial<Record<string, TValue>>> and FormRecord in the docs?
Always use FormRecord, never use FormGroup<Record<...>>. I haven't
written all the docs yet, but I will do so in the coming weeks, including
this topic!
Unless the form group record type is not string but say an enum I
believe... Am I correct?
—
Reply to this email directly, view it on GitHub
<#45607 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFKBQQPGXYX4KNLJPMEOGM3VGFAMLANCNFSM5TIYACGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
As part of the typed forms RFC, we proposed the creation of a new
FormRecord
type, to support dynamic groups with homogenous values. This PR introducesFormRecord
, as a subclass ofFormGroup
.Issue #13721