components/provider/SCContextProvider
Variables
SCContext
constSCContext:Context<SCContextType>
Creates Global Context
Context can be consumed in one of the following ways:
1. <SCContext.Consumer>{settings => (...)}</SCContext.Consumer>
2. const scContext: SCContextType = useContext(SCContext);
3. const scContext: SCContextType = useSCContext();
Functions
SCContextProvider()
SCContextProvider(
__namedParameters):Element
This component imports all providers
Parameters
| Parameter | Type |
|---|---|
__namedParameters | SCContextProviderType |
Returns
Element
<SCContext.Provider value={{settings}}>
useSCContext()
useSCContext():
SCContextType
Let's only export the useSCContext hook instead of the context.
We only want to use the hook directly and never the context component.