Open
Description
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:
export default class Child extends LightningElement {
@api static foo = 'hello'
get staticFoo() {
// expose static prop via the instance
return Child.foo
}
}
<template>
<div>{staticFoo} {foo}</div>
</template>
Parent component:
<template>
<x-child foo="world"></x-child>
</template>
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity