eBay / nice-modal-react

A modal state manager for React.
https://ebay.github.io/nice-modal-react
MIT License
1.96k stars 110 forks source link

Allow setting ResolveType to pass to show method #103

Closed fandridis closed 1 year ago

fandridis commented 1 year ago

I spent quite some time trying to find how to type the the response of the show and couldn't manage that.

Nothing seemed to make it.

With this PR, we are adding an optional ResolveType for the useModal hook, which will pass the type to the Promise resolution of the show method. Otherwise, it will default to unknown as before.

2023-02-03_20h36_01

supnate commented 1 year ago

LGTM, thanks @fandridis !