useProvider
Allows the host that instantiates this useProvider to become the context.
Example of the useProvider hook:
import { createContext, useProvider, c } from "atomico";
export const Theme = createContext({
color: "white",
background: "black"
});
export const App = c(()=>{
useProvider(Theme,{
color: "red",
background: "yellow"
});
return <host shadowDom><slot/></host>
});
Objective
Last updated
Was this helpful?
