Instead of setVisible on the if statement of the custom hook, would it be possible to add styling on the ref inside that if statement? I tried your implementation without setVisible & just to set some styles, but I'm getting an error 'TypeError: Cannot set property 'backgroundColor' of undefined' after I click on the ref div & then click outside it.
This works but for some reason the button is requiring me to click twice to activate the drop down. The first click just selects the button. The 2nd click activates the drop down. Any suggestions anyone?
this is bad because the button is outside the div so if you try to toggle on the div through the button, the ref will reverse the boolean since the button is not the `current`
This tutorial is perfect, I've been looking for something like this forever. Thank you so much!
Instead of setVisible on the if statement of the custom hook, would it be possible to add styling on the ref inside that if statement? I tried your implementation without setVisible & just to set some styles, but I'm getting an error 'TypeError: Cannot set property 'backgroundColor' of undefined' after I click on the ref div & then click outside it.
What happens if the element in document disables bubbling. Document will not receive the click event
This works but for some reason the button is requiring me to click twice to activate the drop down. The first click just selects the button. The 2nd click activates the drop down. Any suggestions anyone?
Hey, cool video! What program do you use for video editing and desktop recording?
thanks for the tutorial!
this is bad because the button is outside the div so if you try to toggle on the div through the button, the ref will reverse the boolean since the button is not the `current`
You saved my life!
Thanks, dude! it works)
Thank you so much, it can be very helpful
Thank you!
great tutorial, thanks :)
Thank you