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.
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
atscott
left a comment
There was a problem hiding this comment.
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
FormRecordtype, to support dynamic groups with homogenous values. This PR introducesFormRecord, as a subclass ofFormGroup.Issue #13721