Closed alexandredev3 closed 1 year ago
Thanks @alexandredev3 , it looks like a nice solution. I will take a look later!
Merging #70 (602677c) into main (6fc6562) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## main #70 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 186 186
Branches 29 29
=========================================
Hits 186 186
Impacted Files | Coverage Δ | |
---|---|---|
src/index.tsx | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Hi @alexandredev3 , tried the PR locally, it behaves differently compared to the old modal.show
api. For now, it seems always requires a type when create a modal: create<MyCompProps>(MyModal)
instead of inferring type from MyModal
. So I reverted the PR.
Hello @supnate, can you provide a demo of what you've tried? I tried to replicate what you've described, but it behaves as said before in this PR. Maybe I'm missing something 🤔.
Hi @alexandredev3 , sorry that I missed the last message. My bad, it's not caused by your pr. now I've recovered it and published in the new version v1.2.7
.
how can i check required props when i use modal.show() with MyComponent name created by modal.create()?
This PR addresses this other PR where it was discussed how to make the types more flexible, but apparently the pr was discontinued.
So, based on @jakst example I created this PR.
examples:![missing_required_modal_props](https://user-images.githubusercontent.com/61118233/177358237-a3353a08-e51f-44b3-8ddc-12ae87de1a45.png)
I think the user should be able to pass a generic to say what props are expected.![modal_show](https://user-images.githubusercontent.com/61118233/177358470-80afccdc-f66c-4439-aabc-54bbb1976939.png)
Here I think the user should pass the required props because, as far as I'm aware, when we add the![show_modal_component](https://user-images.githubusercontent.com/61118233/177358762-96a8e5b0-3a42-43d1-8b16-9c5cfe8926b9.png)
modal component
directly inNiceModal.show()
, we don't have to register the modal or anything.