Closed
Description
Current behavior of rerender
It destroys old component and creates a new one from scratch with given properties.
My thoughts on it
- Name
rerender
does not suggest to me, that component is created from scratch nor old one is destroyed. - Angular-testing-library should behave similar to react-testing-library. React's version of
rerender
does keep existing instance, meaningconstructor
of class andcomponentDidMount
will not be called.render
andcomponentDidUpdate
will get called. Therefore I thinkrerender
should not create the component from scratch but callngOnChanges
with simpleChange parameter containing previous values. Not passed in properties should be removed. rerender
seems to update props instead of replacing them #252 should work withrerender
When the component in rerender
is not created from scratch, I think change is not useful anymore. All properties are controlled from outside. So we can pass in all properties we want to keep in rerender
unmodified again. I guess that's why React's API doesn't have an equivalent of change
.
Metadata
Metadata
Assignees
Labels
No labels