reactjs - If a component is "unmounted" will it ever again be used? -


in react if component unmounted object ever again reused?

use case: let's component sometime's shown higher level in if statement.

if component disappears due state change componentwillunmount call fire of course. when later re-appears due state change, react reuse same component or create scratch? guess there no guarantee of new component, why both willmount , willunmount exist.

no, once unmounted, instance garbage collected if there no references, , separately, if component re-mounted, there new instance.

https://github.com/facebook/react/issues/4770#issuecomment-136928760


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -