How must working componentWillUnmount and why so bad explaination in that code?
I don’t understand your question. I will say that there are times to use CWU and times not to use it. If you feel the explanation is innadequate, it would be a good idea to get in the habit of consulting the documentation. This is something you will be doing all the time as a developer so it will be good to get in the habit.
As to the quality of the instruction, this is an open source curriculum supported by a lot of volunteers. If you have suggestions, you are more than welcome to make them.
Why if you push twice the enter button , eventListener steel working
I’m not clear what you mean, but I was not able to duplicate this. I’ve seen things like that before, but I can’t see it here. Unless you want to be more specific, I’d have to assume that it is a result of whatever browser you are using.
I don’t think the component is actually unmounted by the test so the event listener keeps working (It might also just re-render anyway after the test).
If you change it to say componentDidUpdate instead it would stop working after the first button press.
You might also be able to simulate an unmount of the component