lit.dev icon indicating copy to clipboard operation
lit.dev copied to clipboard

[docs] Improve top level Context example by adding html

Open AndrewJakubowicz opened this issue 1 year ago • 0 comments

It's not clear in the first Context example that the provider should be a parent of the consumer.

This results in a first experience where it's unclear how to arrange the producing and consuming elements. E.g., Placing the elements as siblings does not result in context being shared.

  <my-app></my-app>
  <my-element></my-element>

Instead, my-element (the consumer) must be a descendent of my-app. So the following works:

<my-app>
  <my-element></my-element>
</my-app>

AndrewJakubowicz avatar Sep 15 '23 22:09 AndrewJakubowicz