@@ -968,38 +968,7 @@ function baseCreateRenderer(
968
968
)
969
969
}
970
970
} else {
971
- const instance = ( n2 . component = n1 . component ) !
972
-
973
- if ( shouldUpdateComponent ( n1 , n2 , parentComponent , optimized ) ) {
974
- if (
975
- __FEATURE_SUSPENSE__ &&
976
- instance . asyncDep &&
977
- ! instance . asyncResolved
978
- ) {
979
- // async & still pending - just update props and slots
980
- // since the component's reactive effect for render isn't set-up yet
981
- if ( __DEV__ ) {
982
- pushWarningContext ( n2 )
983
- }
984
- updateComponentPreRender ( instance , n2 , optimized )
985
- if ( __DEV__ ) {
986
- popWarningContext ( )
987
- }
988
- return
989
- } else {
990
- // normal update
991
- instance . next = n2
992
- // in case the child component is also queued, remove it to avoid
993
- // double updating the same child component in the same flush.
994
- invalidateJob ( instance . update )
995
- // instance.update is the reactive effect runner.
996
- instance . update ( )
997
- }
998
- } else {
999
- // no update needed. just copy over properties
1000
- n2 . component = n1 . component
1001
- n2 . el = n1 . el
1002
- }
971
+ updateComponent ( n1 , n2 , parentComponent , optimized )
1003
972
}
1004
973
}
1005
974
@@ -1077,6 +1046,45 @@ function baseCreateRenderer(
1077
1046
}
1078
1047
}
1079
1048
1049
+ const updateComponent = (
1050
+ n1 : VNode ,
1051
+ n2 : VNode ,
1052
+ parentComponent : ComponentInternalInstance | null ,
1053
+ optimized : boolean
1054
+ ) => {
1055
+ const instance = ( n2 . component = n1 . component ) !
1056
+ if ( shouldUpdateComponent ( n1 , n2 , parentComponent , optimized ) ) {
1057
+ if (
1058
+ __FEATURE_SUSPENSE__ &&
1059
+ instance . asyncDep &&
1060
+ ! instance . asyncResolved
1061
+ ) {
1062
+ // async & still pending - just update props and slots
1063
+ // since the component's reactive effect for render isn't set-up yet
1064
+ if ( __DEV__ ) {
1065
+ pushWarningContext ( n2 )
1066
+ }
1067
+ updateComponentPreRender ( instance , n2 , optimized )
1068
+ if ( __DEV__ ) {
1069
+ popWarningContext ( )
1070
+ }
1071
+ return
1072
+ } else {
1073
+ // normal update
1074
+ instance . next = n2
1075
+ // in case the child component is also queued, remove it to avoid
1076
+ // double updating the same child component in the same flush.
1077
+ invalidateJob ( instance . update )
1078
+ // instance.update is the reactive effect runner.
1079
+ instance . update ( )
1080
+ }
1081
+ } else {
1082
+ // no update needed. just copy over properties
1083
+ n2 . component = n1 . component
1084
+ n2 . el = n1 . el
1085
+ }
1086
+ }
1087
+
1080
1088
const setupRenderEffect : SetupRenderEffectFn = (
1081
1089
instance ,
1082
1090
initialVNode ,
0 commit comments