-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Description
Version
3.0.0-beta.12
Reproduction link
https://jsfiddle.net/450026937/whdtnqgk/32/
Steps to reproduce
- Have child component with props declaration, but without using it in render function
- Have parent component using it with props binding, like :key="value"
- Update the "value" in parent component, and will trigger parent component update
What is expected?
Parent component update without calling child component's render function, as child component has it's own render effect.
What is actually happening?
Child component's render function is also invoked, but nothing changed with the node tree.
After looking into the source code, maybe we should split out the processing of parent update & self update in setupRenderEffect().
Making attrs shallow reactive like props will be a good idea, which allow just update child component's attrs & props(also fallthroughAttrs) during parent component update, and leaving child component trigger it's update if needed.
If this is not possible, an additional lifecycle hook, "shouldUpdateCompoent" should be needed to avoid wasted rendering.