I
I
Im p3l2021-08-31 13:16:44
React
Im p3l, 2021-08-31 13:16:44

How to draw two different modal content?

Good afternoon, I have a modal window in which the content is displayed depending on the condition.

It is not possible to change the content of the modal to "Subscription successful disabled" when the subscription is disabled.
And when you click on the "Enable subscription" button, the content of the modal changes to "Enable subscription by clicking on button"

Now it turns out that "Subscription successful disabled" is displayed immediately and "Enable subscription by clicking on button"
The enableSub and disableSub functions emulate sending data to the server, and state emulates receiving data from the server

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Olovyannikov, 2021-08-31
@cannibal_corpse

Pass props and output either one message or another through the condition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question