Does StencilJS re-render a component when an @Prop object or array is mutated in place?
0 reputation · 17 Aug 2025, 05:02 UTC
The goal is to determine whether StencilJS schedules a re-render when a parent mutates a nested property of an @Prop object or an element of an @Prop array without reassigning the prop to a new reference.
Stencil distinguishes @Prop for parent-passed data from @State for component-owned mutable state, but the exact change-detection behavior for nested mutations is unclear. It is not known whether property watchers compare references only, perform shallow comparison, or behave differently across Stencil major versions. This is a design question about expected behavior rather than a reported failure.
Does StencilJS treat an unchanged object or array reference as a non-change for @Prop rendering? Are in-place mutations such as array push, splice, or nested property assignment expected to trigger a re-render? Is replacing the prop with a new reference the documented pattern for propagating nested changes?