N
N
Nikolay Matyushkin2021-03-29 18:00:46
React
Nikolay Matyushkin, 2021-03-29 18:00:46

How to use the state data before the component is unmounted?

Hello! My question is: how can state data be used just before the component is unmounted? In the example, when unmounting, empty strings are returned to us.

ps if the sandbox with the example did not open, then click here

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2021-03-29
@Devilz_1

Devilz_1 , If ​​it is cleaned, then no way. As an option, in the effect of cleaning, save the state to a local variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question