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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -