Skip to content
This repository has been archived by the owner on Jul 7, 2019. It is now read-only.

how to re-render a modal? #13

Open
clindsey opened this issue Nov 7, 2016 · 2 comments
Open

how to re-render a modal? #13

clindsey opened this issue Nov 7, 2016 · 2 comments

Comments

@clindsey
Copy link

clindsey commented Nov 7, 2016

I'm trying to figure out how to update the modal after it's been displayed, like to update a price estimate value. Right now I'm able to modal.add(myComponent, {}) to create a modal and render myComponent but I can't figure out how to update the component. I could remove the modal and display it again with the new props but that would discard the user updates inside the modal, such as form fields.

I'm currently getting around this issue by using connect() on myComponet to link it directly to the store, but I'd prefer to use a basic component and not a redux container. What's the best way to do this? Maybe I should always specify a generic container for the modal and one of the options will be the actual component I want displayed? I feel like the problem will be that the container will need to know about every property any modal will need and will pass those to every modal it displays.

@diegoddox
Copy link
Owner

No, I have no idea on how you can fix that other than use the connect.

@idrm
Copy link

idrm commented May 12, 2017

You can implement an UPDATE_MODAL action that takes as parameters a new component (created with your updated properties for that component class) and the id of the modal that it should replace.

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

No branches or pull requests

3 participants