@@ -69,7 +69,8 @@ const publicPropertiesMap: Record<
6969const enum AccessTypes {
7070 DATA ,
7171 CONTEXT ,
72- PROPS
72+ PROPS ,
73+ OTHER
7374}
7475
7576export const PublicInstanceProxyHandlers : ProxyHandler < any > = {
@@ -104,20 +105,24 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
104105 return renderContext [ key ]
105106 case AccessTypes . PROPS :
106107 return propsProxy ! [ key ]
108+ // default: just fallthrough
107109 }
108110 } else if ( data !== EMPTY_OBJ && hasOwn ( data , key ) ) {
109111 accessCache ! [ key ] = AccessTypes . DATA
110112 return data [ key ]
111113 } else if ( hasOwn ( renderContext , key ) ) {
112114 accessCache ! [ key ] = AccessTypes . CONTEXT
113115 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 ) ) {
117120 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
118125 }
119- // return the value from propsProxy for ref unwrapping and readonly
120- return propsProxy ! [ key ]
121126 }
122127 }
123128
0 commit comments