components/provider/SCAlertMessagesProvider
Variables
SCAlertMessagesContext
const
SCAlertMessagesContext:Context
<SCAlertMessagesContextType
>
Creates Global Context
Context can be consumed in one of the following ways:
1. <SCAlertMessagesContext.Consumer>{(options,) => (...)}</SCAlertMessagesContext.Consumer>
2. const scAlertMessagesContext: SCAlertMessagesContextType = useContext(SCAlertMessagesContext)
3. const scAlertMessagesContext: SCAlertMessagesContextType = useSCAlertMessages();
Source
packages/react-core/src/components/provider/SCAlertMessagesProvider/index.tsx:21
Functions
SCAlertMessagesProvider()
SCAlertMessagesProvider(
children
):JSX.Element
Description:
This component makes the intl
available down the React tree.
Parameters
Parameter | Type | Description |
---|---|---|
children | object | |
children.children | ReactNode | - |
Returns
JSX.Element
<SCAlertMessagesContext.Provider value={{options}}>
Source
packages/react-core/src/components/provider/SCAlertMessagesProvider/index.tsx:32
useSCAlertMessages()
useSCAlertMessages():
SCAlertMessagesContextType
Let's only export the useSCAlertMessages
hook instead of the context.
We only want to use the hook directly and never the context component.
Returns
Source
packages/react-core/src/components/provider/SCAlertMessagesProvider/index.tsx:46