Add displayName to contexts (#8814)
This commit is contained in:
@@ -59,6 +59,7 @@ interface IAvatarContext {
|
||||
}
|
||||
|
||||
const AvatarContext = React.createContext<IAvatarContext>({} as IAvatarContext)
|
||||
AvatarContext.displayName = 'AvatarContext'
|
||||
export const useAvatar = () => React.useContext(AvatarContext)
|
||||
|
||||
const randomColor =
|
||||
|
||||
@@ -3,7 +3,10 @@ import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {AvatarColor, Emoji} from '#/screens/Onboarding/StepProfile/types'
|
||||
import {
|
||||
type AvatarColor,
|
||||
type Emoji,
|
||||
} from '#/screens/Onboarding/StepProfile/types'
|
||||
|
||||
export type OnboardingState = {
|
||||
hasPrev: boolean
|
||||
@@ -147,6 +150,7 @@ export const Context = React.createContext<{
|
||||
state: {...initialState},
|
||||
dispatch: () => {},
|
||||
})
|
||||
Context.displayName = 'OnboardingContext'
|
||||
|
||||
export function reducer(
|
||||
s: OnboardingState,
|
||||
|
||||
@@ -18,6 +18,7 @@ const ItemContext = createContext({
|
||||
destructive: false,
|
||||
withinGroup: false,
|
||||
})
|
||||
ItemContext.displayName = 'SettingsListItemContext'
|
||||
|
||||
const Portal = createPortalGroup()
|
||||
|
||||
|
||||
@@ -246,6 +246,7 @@ interface IContext {
|
||||
dispatch: React.Dispatch<SignupAction>
|
||||
}
|
||||
export const SignupContext = React.createContext<IContext>({} as IContext)
|
||||
SignupContext.displayName = 'SignupContext'
|
||||
export const useSignupContext = () => React.useContext(SignupContext)
|
||||
|
||||
export function useSubmitSignup() {
|
||||
|
||||
@@ -45,6 +45,7 @@ const StateContext = React.createContext<TStateContext>([
|
||||
{} as State,
|
||||
(_: Action) => {},
|
||||
])
|
||||
StateContext.displayName = 'StarterPackWizardStateContext'
|
||||
export const useWizardState = () => React.useContext(StateContext)
|
||||
|
||||
function reducer(state: State, action: Action): State {
|
||||
|
||||
Reference in New Issue
Block a user