How can I dynamically update FormBuilder's JSON in formengine without remounting the component? #63
-
Hi everyone, When editing an existing form, I initialize it using the getForm prop and retrieve the current JSON via builderRef.current.formAsString. I have an image upload feature that should update the image URLs in the JSON (specifically the src property of RsImage components). However, I can't seem to update the builder's internal JSON dynamically. For example, I tried doing:
But since formAsString is a getter, this assignment has no effect. I looked into the source code and noticed there might be an internal method (like updateState), but nothing is exposed publicly. My goal is to update only the image URLs in the JSON (after an image upload) without remounting the FormBuilder—since remounting would lose unsaved user changes. Has anyone encountered this issue? Is there a recommended approach or any public API available for updating the internal JSON of the FormBuilder dynamically? Any workaround or guidance would be greatly appreciated! Thanks in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, @CaptaineHearty |
Beta Was this translation helpful? Give feedback.
Hi, @CaptaineHearty
we plan to add this api within a couple of weeks.