M
M
Maxim Korolsky2016-07-20 06:56:46
React
Maxim Korolsky, 2016-07-20 06:56:46

What is CompomemtWillUnmount used for?

It seems to be there but never used it, it can be a useful thing.
I can not understand why it is needed, can you give a simple example?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RubaXa, 2016-07-20
@RubaXa

// mount
window.addEventListener('scroll', this.handleScroll);

// unmount
window.removeEventListener('scroll', this.handleScroll);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question