Add displayName to contexts (#8814)

This commit is contained in:
Samuel Newman
2025-08-14 01:12:31 +03:00
committed by GitHub
parent 275fece3e3
commit b2c56cbd6d
89 changed files with 173 additions and 28 deletions
@@ -59,6 +59,7 @@ interface IAvatarContext {
}
const AvatarContext = React.createContext<IAvatarContext>({} as IAvatarContext)
AvatarContext.displayName = 'AvatarContext'
export const useAvatar = () => React.useContext(AvatarContext)
const randomColor =
+5 -1
View File
@@ -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()
+1
View File
@@ -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() {
+1
View File
@@ -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 {