Hi there,
I am trying to use Modal to display a form. I render the same form in different component and I want to reuse this form inside the Modal.
How can I reuse this form inside the modal? I was able to render the same form only if I copy it inside the new react app and point the resources in manifest to this new react app, but this force me to duplicate code of the form.
Modal code:
const modal = new Modal({
resource: 'modalTest',
onClose: (payload) => {
console.log('onClose called with', payload);
setIsOpen(false);
},
size: 'max',
});
Manifest:
resources:
- key: main-issue
path: static/issue/build
- key: modalTest
path: static/modalTest/build
The original form is in static/issue/build,
so how can I reuse this form from the same app where I am opening the modal?
Thank you