diff --git a/packages/interactivity/src/proxies/state.ts b/packages/interactivity/src/proxies/state.ts index 7b9c0bf4ea09c..0978fa2ccd026 100644 --- a/packages/interactivity/src/proxies/state.ts +++ b/packages/interactivity/src/proxies/state.ts @@ -168,7 +168,15 @@ const stateHandlers: ProxyHandler< object > = { objToIterable.get( target )!.value++; } - if ( Array.isArray( target ) ) { + /* + * Modify the `length` property value only if the related + * `PropSignal` exists, which means that there are subscriptions to + * this property. + */ + if ( + Array.isArray( target ) && + proxyToProps.get( receiver )?.has( 'length' ) + ) { const length = getPropSignal( receiver, 'length' ); length.setValue( target.length ); }