-
Notifications
You must be signed in to change notification settings - Fork 878
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
[labs/context] @provide
decorator does not work with Babel
#3806
Comments
Here are some findings after investigating. The
When this is used without providing a When doing lit/packages/reactive-element/src/decorators/base.ts Lines 89 to 94 in a1f8c34
originalKey is not carried over in Babel's implementation for chaining decorators.
I think the single Considering that Babel's removing support for the "2018-09" version (babel/babel#12712), I wonder if it's worth our time to even consider fixing this. cc: @justinfagnani |
Not planning on supporting the nonstandard 2018 Babel transform with context |
See discussion below.
Decorators work fine with TS.
With Babel:
@provide()
on its own does not work.@provide() @property()
does not work.@property() @provide
actually seems to make the context providing work but value is not accessible from the host component.Discussed in #3804
Originally posted by jrj2211 April 13, 2023
I have an element that is providing some async loaded data from an API. I have children inside the element consuming the context, which is working.
I need my provider to also use the data being provided in the context, but it the property just comes back undefined?
Logging out the loaded user, its
undefined
. The child user-contact that@consumes
theuserContext
, gets the data.Is this correct? The documentation show adding
@property
along with@provide
, so why isn't the value available in the provider element viathis.user
?The text was updated successfully, but these errors were encountered: