-
Notifications
You must be signed in to change notification settings - Fork 93
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
rerenderdoes 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
rerenderdoes keep existing instance, meaningconstructorof class andcomponentDidMountwill not be called.renderandcomponentDidUpdatewill get called. Therefore I thinkrerendershould not create the component from scratch but callngOnChangeswith simpleChange parameter containing previous values. Not passed in properties should be removed. rerenderseems 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