Way Provider
Props
- context
- all
context
type: object
context we want to provide to webcomponents
all
type: boolean
when set to true you don't need useWayContext, all the child components will get those props be aware this might overwrite some props
Tips:
You should not use nested objects or arrays as context
When used with "all" prop all the child webcomponents will get those even if they are inserted in the dom tree after way-provider
WayProvider "knows" an element is an webcomponent by checking customElements registry
Example
const context = {
url: 'http://localhost:3000/',
lang: 'en'
}
<way-provider context={context}>
{...children}
</way-provider>