You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using @api on a static property will result in the property being parsed as an instance prop. @api static foo is treated as if it were the same as @api foo, although any initial values are preserved on the static prop.
Steps to Reproduce
Child component:
exportdefaultclassChildextendsLightningElement{
@apistaticfoo='hello'getstaticFoo(){// expose static prop via the instancereturnChild.foo}}
Description
Using
@api
on a static property will result in the property being parsed as an instance prop.@api static foo
is treated as if it were the same as@api foo
, although any initial values are preserved on the static prop.Steps to Reproduce
Child component:
Parent component:
Expected Results
Using
@api
,@wire
, or@track
on a static property should be a compiler error, because the decorators only make sense to use on component instances.Actual Results
The example above will render
<div>hello world</div>
.@wire
and@track
behave similarly.The text was updated successfully, but these errors were encountered: