Search posts, tags, users, and pages
Shivam Sharma
Software Developer
During my internship. One day I was working on building some dropdown filters for our company's product. Initially, I thought yeah it's not too big a deal. I can simply store one state and render the list on setting the state as true. So initial phas...
Bhargav Ponnapalli
Good one Shivam Sharma.
I wrote a hook called to do this as well. Clicking outside is a very common feature for dropdowns, modals etc. So I made this hook.
react-hooks.org/docs/use-outside-click-ref Check it out if you get a chance!
Cheers!
Hashnoder | Frontend Developer | Youtuber
Wow! that was pretty simple, surely gonna use it. Thanks:)
Rutik Wankhade
This is great. I needed this for modals. ๐ Thanks Bhargav Ponnapalli
Check out react-hooks.org. There should be quite a few hooks that you can use. Of course you can install all or one by one, they are ESM compatible so you won't have more hooks than you need in the final bundle. Rutik Wankhade
Bhargav Ponnapalli
Good one Shivam Sharma.
I wrote a hook called to do this as well. Clicking outside is a very common feature for dropdowns, modals etc. So I made this hook.
react-hooks.org/docs/use-outside-click-ref Check it out if you get a chance!
Cheers!