Skip to main content

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

packages/react-core/src/components/provider/SCRoutingProvider/index.tsx:40

Functions

SCRoutingProvider

SCRoutingProvider(children): JSX.Element

Description:

This component provides routing context.

Parameters

NameType
childrenObject
children.childrenReactNode

Returns

JSX.Element

<SCRoutingContext.Provider value={contextValue}>{children}</SCRoutingContext.Provider>

Defined in

packages/react-core/src/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.

Returns

SCRoutingContextType

Defined in

packages/react-core/src/components/provider/SCRoutingProvider/index.tsx:141