Skip to content
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

models within arrays #51

Open
dferber90 opened this issue Apr 22, 2023 · 0 comments
Open

models within arrays #51

dferber90 opened this issue Apr 22, 2023 · 0 comments

Comments

@dferber90
Copy link

dferber90 commented Apr 22, 2023

I'm trying to build a generic form library on top of @expressive/react. I am imagining a form where some fields are added to the form dynamically, for example when somebody adds a list of guests. Imagine a "Add guest" button which appends a new input field that allows the user to enter that guests name.

To reproduce a simpler version of this, I created this playground which dynamically adds new counters: https://codesandbox.io/s/example-counter-forked-ttk3ir?file=/src/App.js

This video shows how the counters only update if I force an update on the parent model.

Kapture.2023-04-22.at.11.42.14.mp4

Since I am trying to build a generic form library, I am attempting to use models inside of models. But it seems like the individual counters are not updated unless the parent is forced to update.

Is using models within models supported today? Any ideas what I might be doing wrong?

Here is a more complete example of where I want to go, which struggles from the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant