You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But swapping the imports would again break the slotted consumer.
The fix for this situation is to add a ContextRoot and attach it to document.body.
Solution
ContextRoot is already documented: https://lit.dev/docs/data/context/#contextroot, however I think it could use some documentation above the API section with why you should use it and the tradeoffs.
The text was updated successfully, but these errors were encountered:
While making the basic context example I ran into a footgun with element upgrade order or import order.
I made this example: https://lit.dev/playground/#gist=3ddd4d9368a408508f88a5ae328478a3
However due to the timing of component upgrading, the provider didn't work inside the
<slot>
, which confused me.Having two script imports in the example fixed the issue, e.g.:
But swapping the imports would again break the slotted consumer.
The fix for this situation is to add a
ContextRoot
and attach it to document.body.Solution
ContextRoot is already documented: https://lit.dev/docs/data/context/#contextroot, however I think it could use some documentation above the API section with why you should use it and the tradeoffs.
The text was updated successfully, but these errors were encountered: