D
D
Daniil Sugonyaev2018-10-17 20:07:06
JavaScript
Daniil Sugonyaev, 2018-10-17 20:07:06

How to close filters on momo click in React?

Implemented filters that unfold on click, close on the second. However, it is necessary that the filter closes when clicking on any other area of ​​the page, tell me the best way to implement it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yanis_kondakov, 2018-10-17
@coolswood

https://codesandbox.io/s/jv7p4xj87v
I do not pretend to the correct organization of states and other things. Obviously openSection should not be stored in OutsideClicked and stuff. The main thing is that it is clear how to do what you asked

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question