Answer the question
In order to leave comments, you need to log in
How to close all popovers and inputs?
Hello.
The application has several lists and various popovers (menus). Also, when you select the "edit" menu, input appears.
For example, we click on the menu - a popover pops up.
How to make it so that when you click "outside" this list (element) or when you click on the menu of the next element, all popovers are automatically closed? Create an isShowing variable in the state, and change the state every time you click through the reducer?
Thank you
Answer the question
In order to leave comments, you need to log in
You can.)
Here, in any store. It is possible to have the state of a higher component and manipulate the descendants, but in order not to fence this, they came up with Redux.)
Or like this:
In the store, define isShowing and in the state of the inputs pass through the context.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question