I
I
Ibishka2020-06-12 08:33:16
React
Ibishka, 2020-06-12 08:33:16

How to show the component on click and close from the component itself?

I have a list popup component, I open it with a button on the home cabinet pages, media through the state I show the component. In list, i.e. in the component itself, there is a cancel button that should close the popup. Briefly how to open from outside the list component and close inside the list component. Use user reducer?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forspamonly2, 2020-06-12
@forspamonly2

if the display flag of this component is in the state of the parent component, then you need to pass a function to the component to set the value from this state

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question