-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
I have 2 custom elements created with solid-element. One is a context provider and the other is a consumer.
<sld-component-a message="hello world"> // message gets added to a provider
<sld-component-b></sld-component-b> // hello world gets rendered in here
</sld-component-a>It works fine if the consuming element is a direct child of the provider. However, when the child is further down in the DOM the consumer will instead get the default value of the context instead.
<sld-component-a message="hello world">
<div>
<sld-component-b></sld-component-b> // renders the default context value instead of the updated value from the message
</div>
</sld-component-a>Working example:
https://stackblitz.com/edit/solid-vite-se4fzw?file=src/index.tsx
Metadata
Metadata
Assignees
Labels
No labels