Module: components/provider/SCRoutingProvider
Variables
SCRoutingContext
• Const
SCRoutingContext: Context
<SCRoutingContextType
>
Creates Global Context
Context can be consumed in one of the following ways:
1. <SCRoutingContext.Consumer>{(routerLink, routes, url) => (...)}</SCRoutingContext.Consumer>
2. const scRoutingContext: SCRoutingContextType = useContext(SCRoutingContext);
3. const scRoutingContext: SCRoutingContextType = useSCRouting();
Defined in
components/provider/SCRoutingProvider/index.tsx:40
Functions
SCRoutingProvider
▸ SCRoutingProvider(children
): JSX.Element
Description:
This component provides routing context.
Parameters
Name | Type |
---|---|
children | Object |
children.children | ReactNode |
Returns
JSX.Element
<SCRoutingContext.Provider value={contextValue}>{children}</SCRoutingContext.Provider>
Defined in
components/provider/SCRoutingProvider/index.tsx:51
useSCRouting
▸ useSCRouting(): SCRoutingContextType
Let's only export the useSCTheme
hook instead of the context.
We only want to use the hook directly and never the context component.