Answer the question
In order to leave comments, you need to log in
How to change the class of an element on click outside of an element in React?
In codesandbox, I have a clickoutside hook that allows you to change the state on a click past the block, and it works. The block appears and disappears as it should. Now he just renders it, which does not suit me. I need the is-open class to be removed on click outside the block and I hide it using css (the styles in the example are already ready). I can't seem to get it to work the way it should. Thank you in advance.
https://codesandbox.io/s/quiet-cdn-judrq?file=/src...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question