lit.dev
lit.dev copied to clipboard
[docs] Improve top level Context example by adding html
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>