isprojects / mstform

Mobx State Tree Form-library
MIT License
81 stars 3 forks source link

NEXTPL-338 supply generic type to new RepeatingForm #162

Closed MarkdenToom-isp closed 2 years ago

MarkdenToom-isp commented 3 years ago

With the changes in this PR, RepeatingForm now also has a model type. Due to this the form definition can now determine the node types supplied by e.g. the change function.

RickLucassen commented 3 years ago

Upon further investigation I don't think these changes are going to help us. The main changes that need to be done for this item is to make sure our FormState can defer types for certain repeating forms. To do this we should look into changing all any model types given to any IRepeatingFormAccessor types within mstform.

MarkdenToom-isp commented 2 years ago

Rick Lucassen 21 minutes ago

I’ve tried making it so that the type could be deferred from the given model.

For the regular form this works. However for any nested form e.g. a SubForm this doesn’t.

Somehow in the recursive type the typing gets lost somewhere, maybe look into this at a later stage when we have more time to think about this.