Does TypeScript private hide a @Prop property from StencilJS public API?
0 reputation · 08 Mar 2026, 03:42 UTC
I am building a StencilJS component and need certain reactive properties to remain internal implementation details. The @Prop decorator exposes properties through the custom element's attribute and property interface, so I want to confirm whether TypeScript's private modifier prevents them from becoming part of the public API at runtime.
StencilJS has no dedicated private prop decorator, and TypeScript access modifiers are erased during compilation. I am targeting StencilJS v4 and want to avoid external scripts mutating internal state through the DOM element.
Does a private @Prop property appear in the generated custom element API or StencilJS documentation? What is the supported pattern for keeping reactive state inaccessible to consumers while still using property change tracking?