Apply the @track
decorator to class fields only.
Example of incorrect code:
import { track } from 'lwc';
@track
class Foo {}
class Foo {
@track
trackedMethod() {}
}
class Foo {
@track
set state(value) {}
}
class Foo {
@track
static state;
}
Example of correct code:
import { track } from 'lwc';
class Foo {
@track
state;
}