B
B
beefront172018-07-11 09:45:51
JavaScript
beefront17, 2018-07-11 09:45:51

Display element on click, react?

Good afternoon! Please help me find a ready-made solution ( react ).
Problem following:
It is necessary to deduce dropdown at a clique at an element on which clicked. The Layout of the application is built in such a way that this dropdown cannot be above all elements, I cannot give it a z-index and css solve this problem. Accordingly, it is necessary that this dropdown be inserted at the top level, somewhere near the body.
The question is whether there is any ready-made solution for react, so that the element is inserted somewhere near the body and displayed at the element on which the event took place.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Svyatoslav, 2018-07-11
@beefront17

Yes, it's called portals, here's the section in the documentation:
https://reactjs.org/docs/portals.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question