@@ -69,7 +69,8 @@ const publicPropertiesMap: Record<
69
69
const enum AccessTypes {
70
70
DATA ,
71
71
CONTEXT ,
72
- PROPS
72
+ PROPS ,
73
+ OTHER
73
74
}
74
75
75
76
export const PublicInstanceProxyHandlers : ProxyHandler < any > = {
@@ -104,20 +105,24 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
104
105
return renderContext [ key ]
105
106
case AccessTypes . PROPS :
106
107
return propsProxy ! [ key ]
108
+ // default: just fallthrough
107
109
}
108
110
} else if ( data !== EMPTY_OBJ && hasOwn ( data , key ) ) {
109
111
accessCache ! [ key ] = AccessTypes . DATA
110
112
return data [ key ]
111
113
} else if ( hasOwn ( renderContext , key ) ) {
112
114
accessCache ! [ key ] = AccessTypes . CONTEXT
113
115
return renderContext [ key ]
114
- } else if ( hasOwn ( props , key ) ) {
115
- // only cache props access if component has declared (thus stable) props
116
- if ( type . props != null ) {
116
+ } else if ( type . props != null ) {
117
+ // only cache other properties when instance has declared (this stable)
118
+ // props
119
+ if ( hasOwn ( props , key ) ) {
117
120
accessCache ! [ key ] = AccessTypes . PROPS
121
+ // return the value from propsProxy for ref unwrapping and readonly
122
+ return propsProxy ! [ key ]
123
+ } else {
124
+ accessCache ! [ key ] = AccessTypes . OTHER
118
125
}
119
- // return the value from propsProxy for ref unwrapping and readonly
120
- return propsProxy ! [ key ]
121
126
}
122
127
}
123
128
0 commit comments