-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@api
decorated property is not reactive with private class properties
#4214
Labels
Comments
This seems to be an issue with either var _localCounter;
function _classPrivateFieldLooseBase(receiver, privateKey) {
// ...
}
// ...
var _xCounter = registerComponent(registerDecorators((_localCounter = /*#__PURE__*/
_classPrivateFieldLooseKey("localCounter"), /* ... */ Fixing this may rely on fixing #3537 first. |
@api
decorated property is not reactive with private class properties
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I'm using a getter/setter to perform side effects whenever a
@api
property is updated, and tracking the value with a local property. However, I noticed when using a private property (prefixed with#
) to track the value, the decorated property is no longer reactive and the rendered output will not update until a separate update occurs. Using a non-private property to track the value also works as expected.Steps to Reproduce
https://stackblitz.com/edit/salesforce-lwc-qhbdic?file=src%2Fmodules%2Fx%2Fcounter%2Fcounter.js
Expected Results
Updates to a private property from a
@api
decorated setter should be reactive and reflected in the rendered output.Actual Results
The rendered output is not updated when a private property updates.
Browsers Affected
Version
Possible Solution
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: