Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would this be possible? #27

Open
gino opened this issue May 23, 2021 · 1 comment
Open

Would this be possible? #27

gino opened this issue May 23, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@gino
Copy link

gino commented May 23, 2021

Hi there,

I was looking for a similar approach to use modals with a hook like this, but I was wondering if something like this would be possible, cause this would be a very nice approach:

const { isModalOpen, openModal, closeModal } = useModal(<div>This is my modal</div>);

So you are able to pass elements into the useModal hook so you do not have to put any <Modal> logic into the DOM itself, and without passing props either. This is a similar library that allows you to do that, but unfortunately not really active and has some issues. But I think that would be a very nice approach, not sure if it's possible without having to change a lot of things though.

I just think that it would be a nice idea, I would really prefer this method myself to keep my modals out of the structure itself.

@mbrookson
Copy link
Owner

mbrookson commented Jul 4, 2021

@gino Thanks for the suggestion! Definitely open to this idea. Feel free to PR a change, otherwise I will try to get round to implementing this in the near future.

@mbrookson mbrookson added the enhancement New feature or request label Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants