-
Notifications
You must be signed in to change notification settings - Fork 795
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
bug: watch decorator doesn't work if we change the original tag name #3554
Comments
The community in slack was help me and one guy said that the problem is here
$tagName$ is defined in your file as "my-component", so this callback never fires Then
is always false (meaning the watch is never triggered Looks like changing:
to
makes it work, but maybe it breaks things elsewhere I hope this could help! |
Hi @urielblanco 👋 Thanks for reporting this issue and the additional context to problematic code! I was able to verify the problem in your reproduction repo. I'll go ahead and get this labeled appropriately so we can get this refined and into our backlog. Thanks again! |
@urielblanco thanks for providing the solution to this bug. I raised a PR in #5767 to bring this into Stencil. |
A fix for this was released as a part of Stencil's v4.18.2 release! |
Prerequisites
Stencil Version
2.13.0
Current Behavior
My problem is that the
@Watch
decorator only works if I keep the original tag name.My vanilla js app
My simple component
With this example, I can see in the console that the watch func triggered 🙌🏽
Expected Behavior
Suppose I change the original tag name when I define my component in customElement.define() I hope that the
@Watch
decorator keeps working but it doesn't.Steps to Reproduce
You can recreate my example in Current behavior or download it and run the scripts like this:
And that's it! If you change the tag name from "my-component" to "my-component-test" the watch func stop working and you can't see in the console my message.
Code Reproduction URL
https://github.com/urielblanco/test-watch
Additional Information
No response
The text was updated successfully, but these errors were encountered: