Module: components/provider/SCNotificationProvider
Variables
SCNotificationContext
• Const
SCNotificationContext: Context
<SCNotificationContextType
>
Creates Global Context
Context can be consumed in one of the following ways:
1. <SCNotificationContext.Consumer>{(wsInstance, subscribe,) => (...)}</SCNotificationContext.Consumer>
2. const scNotificationContext: SCNotificationContextType = useContext(SCNotificationContext);
3. const scNotificationContext: SCNotificationContextType = useSCNotification();
Defined in
components/provider/SCNotificationProvider/index.tsx:22
Functions
SCNotificationProvider
▸ SCNotificationProvider(children
): JSX.Element
Description:
This component makes the notification context available down the React tree.
Parameters
Name | Type |
---|---|
children | Object |
children.children | ReactNode |
Returns
JSX.Element
<SCNotificationContext.Provider value={{wsInstance}}>{children}</SCNotificationContext.Provider>
Defined in
components/provider/SCNotificationProvider/index.tsx:33
useSCNotification
▸ useSCNotification(): SCNotificationContextType
Let's only export the useSCNotification
hook instead of the context.
We only want to use the hook directly and never the context component.