diff --git a/__mocks__/@gorhom/bottom-sheet.tsx b/__mocks__/@gorhom/bottom-sheet.tsx --- a/__mocks__/@gorhom/bottom-sheet.tsx +++ b/__mocks__/@gorhom/bottom-sheet.tsx @@ -1,7 +1,8 @@ -import React, {ReactNode} from 'react' -import {View, ScrollView, Modal, FlatList, TextInput} from 'react-native' +import React, {type ReactNode} from 'react' +import {FlatList, Modal, ScrollView, TextInput, View} from 'react-native' const BottomSheetModalContext = React.createContext(null) +BottomSheetModalContext.displayName = 'BottomSheetModalContext' const BottomSheetModalProvider = (props: any) => { return @@ -47,13 +48,13 @@ export {useBottomSheetInternal} export {useBottomSheetDynamicSnapPoints} export { - BottomSheetModalProvider, BottomSheetBackdrop, + BottomSheetFlatList, + BottomSheetFooter, BottomSheetHandle, BottomSheetModal, - BottomSheetFooter, + BottomSheetModalProvider, BottomSheetScrollView, - BottomSheetFlatList, BottomSheetTextInput, } diff --git a/modules/bottom-sheet/src/BottomSheetPortal.tsx b/modules/bottom-sheet/src/BottomSheetPortal.tsx --- a/modules/bottom-sheet/src/BottomSheetPortal.tsx +++ b/modules/bottom-sheet/src/BottomSheetPortal.tsx @@ -5,6 +5,7 @@ type PortalContext = React.ElementType<{children: React.ReactNode}> export const Context = React.createContext({} as PortalContext) +Context.displayName = 'BottomSheetPortalContext' export const useBottomSheetPortal_INTERNAL = () => React.useContext(Context) diff --git a/modules/bottom-sheet/src/lib/Portal.tsx b/modules/bottom-sheet/src/lib/Portal.tsx --- a/modules/bottom-sheet/src/lib/Portal.tsx +++ b/modules/bottom-sheet/src/lib/Portal.tsx @@ -18,6 +18,7 @@ outlet: null, append: () => {}, remove: () => {}, }) + Context.displayName = 'BottomSheetPortalContext' function Provider(props: React.PropsWithChildren<{}>) { const map = React.useRef({}) diff --git a/src/alf/index.tsx b/src/alf/index.tsx --- a/src/alf/index.tsx +++ b/src/alf/index.tsx @@ -8,9 +8,9 @@ setFontFamily as persistFontFamily, setFontScale as persistFontScale, } from '#/alf/fonts' import {createThemes, defaultTheme} from '#/alf/themes' -import {Theme, ThemeName} from '#/alf/types' +import {type Theme, type ThemeName} from '#/alf/types' import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration' -import {Device} from '#/storage' +import {type Device} from '#/storage' export {atoms} from '#/alf/atoms' export * from '#/alf/breakpoints' @@ -61,6 +61,7 @@ setFontFamily: () => {}, }, flags: {}, }) +Context.displayName = 'AlfContext' export function ThemeProvider({ children, diff --git a/src/components/Admonition.tsx b/src/components/Admonition.tsx --- a/src/components/Admonition.tsx +++ b/src/components/Admonition.tsx @@ -23,6 +23,7 @@ const Context = createContext({ type: 'info', }) +Context.displayName = 'AdmonitionContext' export function Icon() { const t = useTheme() diff --git a/src/components/Button.tsx b/src/components/Button.tsx --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -109,6 +109,7 @@ focused: false, pressed: false, disabled: false, }) +Context.displayName = 'ButtonContext' export function useButtonContext() { return React.useContext(Context) diff --git a/src/components/ContextMenu/context.tsx b/src/components/ContextMenu/context.tsx --- a/src/components/ContextMenu/context.tsx +++ b/src/components/ContextMenu/context.tsx @@ -7,10 +7,13 @@ type MenuContextType, } from '#/components/ContextMenu/types' export const Context = React.createContext(null) +Context.displayName = 'ContextMenuContext' export const MenuContext = React.createContext(null) +MenuContext.displayName = 'ContextMenuMenuContext' export const ItemContext = React.createContext(null) +ItemContext.displayName = 'ContextMenuItemContext' export function useContextMenuContext() { const context = React.useContext(Context) diff --git a/src/components/Dialog/context.ts b/src/components/Dialog/context.ts --- a/src/components/Dialog/context.ts +++ b/src/components/Dialog/context.ts @@ -23,6 +23,7 @@ disableDrag: false, setDisableDrag: () => {}, isWithinDialog: false, }) +Context.displayName = 'DialogContext' export function useDialogContext() { return useContext(Context) diff --git a/src/components/Grid.tsx b/src/components/Grid.tsx --- a/src/components/Grid.tsx +++ b/src/components/Grid.tsx @@ -1,11 +1,12 @@ import {createContext, useContext, useMemo} from 'react' import {View} from 'react-native' -import {atoms as a, ViewStyleProp} from '#/alf' +import {atoms as a, type ViewStyleProp} from '#/alf' const Context = createContext({ gap: 0, }) +Context.displayName = 'GridContext' export function Row({ children, diff --git a/src/components/Layout/Header/index.tsx b/src/components/Layout/Header/index.tsx --- a/src/components/Layout/Header/index.tsx +++ b/src/components/Layout/Header/index.tsx @@ -77,6 +77,7 @@ ) } const AlignmentContext = createContext<'platform' | 'left'>('platform') +AlignmentContext.displayName = 'AlignmentContext' export function Content({ children, diff --git a/src/components/Layout/context.ts b/src/components/Layout/context.ts --- a/src/components/Layout/context.ts +++ b/src/components/Layout/context.ts @@ -3,3 +3,4 @@ export const ScrollbarOffsetContext = React.createContext({ isWithinOffsetView: false, }) +ScrollbarOffsetContext.displayName = 'ScrollbarOffsetContext' diff --git a/src/components/Menu/context.tsx b/src/components/Menu/context.tsx --- a/src/components/Menu/context.tsx +++ b/src/components/Menu/context.tsx @@ -3,8 +3,10 @@ import {type ContextType, type ItemContextType} from '#/components/Menu/types' export const Context = React.createContext(null) +Context.displayName = 'MenuContext' export const ItemContext = React.createContext(null) +ItemContext.displayName = 'MenuItemContext' export function useMenuContext() { const context = React.useContext(Context) diff --git a/src/components/PolicyUpdateOverlay/context.tsx b/src/components/PolicyUpdateOverlay/context.tsx --- a/src/components/PolicyUpdateOverlay/context.tsx +++ b/src/components/PolicyUpdateOverlay/context.tsx @@ -28,6 +28,7 @@ * sigin/signup/onboarding in `createNativeStackNavigatorWithAuth`. */ setIsReadyToShowOverlay: () => {}, }) +Context.displayName = 'PolicyUpdateOverlayContext' export function usePolicyUpdateContext() { const context = useContext(Context) diff --git a/src/components/Portal.tsx b/src/components/Portal.tsx --- a/src/components/Portal.tsx +++ b/src/components/Portal.tsx @@ -28,6 +28,7 @@ outlet: null, append: () => {}, remove: () => {}, }) + Context.displayName = 'PortalContext' function Provider(props: React.PropsWithChildren<{}>) { const map = useRef({}) diff --git a/src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx b/src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx --- a/src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx +++ b/src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx @@ -15,6 +15,7 @@ activeViewId: string | null setActiveView: (viewId: string) => void sendViewPosition: (viewId: string, y: number) => void } | null>(null) +Context.displayName = 'ActiveVideoWebContext' export function Provider({children}: {children: React.ReactNode}) { if (!isWeb) { diff --git a/src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx b/src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx --- a/src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx +++ b/src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx @@ -8,6 +8,7 @@ // web volume: number setVolume: React.Dispatch> } | null>(null) +Context.displayName = 'VideoVolumeContext' export function Provider({children}: {children: React.ReactNode}) { const [muted, setMuted] = React.useState(true) diff --git a/src/components/Post/Embed/VideoEmbed/index.web.tsx b/src/components/Post/Embed/VideoEmbed/index.web.tsx --- a/src/components/Post/Embed/VideoEmbed/index.web.tsx +++ b/src/components/Post/Embed/VideoEmbed/index.web.tsx @@ -125,6 +125,7 @@ ) } const NearScreenContext = createContext(false) +NearScreenContext.displayName = 'VideoNearScreenContext' /** * Renders a 100vh tall div and watches it with an IntersectionObserver to diff --git a/src/components/PostControls/PostControlButton.tsx b/src/components/PostControls/PostControlButton.tsx --- a/src/components/PostControls/PostControlButton.tsx +++ b/src/components/PostControls/PostControlButton.tsx @@ -13,6 +13,7 @@ big?: boolean active?: boolean color?: {color: string} }>({}) +PostControlContext.displayName = 'PostControlContext' // Base button style, which the the other ones extend export function PostControlButton({ diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -27,6 +27,7 @@ }>({ titleId: '', descriptionId: '', }) +Context.displayName = 'PromptContext' export function Outer({ children, diff --git a/src/components/Select/index.tsx b/src/components/Select/index.tsx --- a/src/components/Select/index.tsx +++ b/src/components/Select/index.tsx @@ -34,10 +34,12 @@ control: Dialog.DialogControlProps } & Pick const Context = createContext(null) +Context.displayName = 'SelectContext' const ValueTextContext = createContext< [any, React.Dispatch>] >([undefined, () => {}]) +ValueTextContext.displayName = 'ValueTextContext' function useSelectContext() { const ctx = useContext(Context) @@ -229,6 +231,7 @@ hovered: false, focused: false, pressed: false, }) +ItemContext.displayName = 'SelectItemContext' export function useItemContext() { return useContext(ItemContext) diff --git a/src/components/Select/index.web.tsx b/src/components/Select/index.web.tsx --- a/src/components/Select/index.web.tsx +++ b/src/components/Select/index.web.tsx @@ -23,6 +23,7 @@ type ValueProps, } from './types' const SelectedValueContext = createContext(null) +SelectedValueContext.displayName = 'SelectSelectedValueContext' export function Root(props: RootProps) { return ( @@ -219,6 +220,7 @@ focused: false, pressed: false, selected: false, }) +ItemContext.displayName = 'SelectItemContext' export function useItemContext() { return useContext(ItemContext) diff --git a/src/components/Toast/Toast.tsx b/src/components/Toast/Toast.tsx --- a/src/components/Toast/Toast.tsx +++ b/src/components/Toast/Toast.tsx @@ -24,6 +24,7 @@ const Context = createContext({ type: 'default', }) +Context.displayName = 'ToastContext' export function Toast({ type, diff --git a/src/components/Tooltip/index.tsx b/src/components/Tooltip/index.tsx --- a/src/components/Tooltip/index.tsx +++ b/src/components/Tooltip/index.tsx @@ -53,12 +53,14 @@ position: 'bottom', visible: false, onVisibleChange: () => {}, }) +TooltipContext.displayName = 'TooltipContext' const TargetContext = createContext({ targetMeasurements: undefined, setTargetMeasurements: () => {}, shouldMeasure: false, }) +TargetContext.displayName = 'TargetContext' export function Outer({ children, diff --git a/src/components/Tooltip/index.web.tsx b/src/components/Tooltip/index.web.tsx --- a/src/components/Tooltip/index.web.tsx +++ b/src/components/Tooltip/index.web.tsx @@ -20,6 +20,7 @@ const TooltipContext = createContext({ position: 'bottom', onVisibleChange: () => {}, }) +TooltipContext.displayName = 'TooltipContext' export function Outer({ children, diff --git a/src/components/dialogs/Context.tsx b/src/components/dialogs/Context.tsx --- a/src/components/dialogs/Context.tsx +++ b/src/components/dialogs/Context.tsx @@ -27,6 +27,7 @@ ageAssuranceRedirectDialogControl: StatefulControl } const ControlsContext = createContext(null) +ControlsContext.displayName = 'GlobalDialogControlsContext' export function useGlobalDialogsControlContext() { const ctx = useContext(ControlsContext) diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx --- a/src/components/dialogs/nuxs/index.tsx +++ b/src/components/dialogs/nuxs/index.tsx @@ -47,6 +47,7 @@ const Context = React.createContext({ activeNux: undefined, dismissActiveNux: () => {}, }) +Context.displayName = 'NuxDialogContext' export function useNuxDialogContext() { return React.useContext(Context) diff --git a/src/components/dms/MessageContext.tsx b/src/components/dms/MessageContext.tsx --- a/src/components/dms/MessageContext.tsx +++ b/src/components/dms/MessageContext.tsx @@ -1,6 +1,7 @@ import React from 'react' const MessageContext = React.createContext(false) +MessageContext.displayName = 'MessageContext' export function MessageContextProvider({ children, diff --git a/src/components/forms/TextField.tsx b/src/components/forms/TextField.tsx --- a/src/components/forms/TextField.tsx +++ b/src/components/forms/TextField.tsx @@ -46,6 +46,7 @@ focused: false, onFocus: () => {}, onBlur: () => {}, }) +Context.displayName = 'TextFieldContext' export type RootProps = React.PropsWithChildren<{isInvalid?: boolean}> diff --git a/src/components/forms/Toggle.tsx b/src/components/forms/Toggle.tsx --- a/src/components/forms/Toggle.tsx +++ b/src/components/forms/Toggle.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {Pressable, View, ViewStyle} from 'react-native' +import {Pressable, View, type ViewStyle} from 'react-native' import Animated, {LinearTransition} from 'react-native-reanimated' import {HITSLOP_10} from '#/lib/constants' @@ -8,9 +8,9 @@ import { atoms as a, flatten, native, - TextStyleProp, + type TextStyleProp, useTheme, - ViewStyleProp, + type ViewStyleProp, } from '#/alf' import {useInteractionState} from '#/components/hooks/useInteractionState' import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check' @@ -35,6 +35,7 @@ hovered: false, pressed: false, focused: false, }) +ItemContext.displayName = 'ToggleItemContext' const GroupContext = React.createContext<{ values: string[] @@ -49,6 +50,7 @@ disabled: false, maxSelectionsReached: false, setFieldValue: () => {}, }) +GroupContext.displayName = 'ToggleGroupContext' export type GroupProps = React.PropsWithChildren<{ type?: 'radio' | 'checkbox' diff --git a/src/components/intents/IntentDialogs.tsx b/src/components/intents/IntentDialogs.tsx --- a/src/components/intents/IntentDialogs.tsx +++ b/src/components/intents/IntentDialogs.tsx @@ -1,7 +1,7 @@ import React from 'react' import * as Dialog from '#/components/Dialog' -import {DialogControlProps} from '#/components/Dialog' +import {type DialogControlProps} from '#/components/Dialog' import {VerifyEmailIntentDialog} from '#/components/intents/VerifyEmailIntentDialog' interface Context { @@ -11,6 +11,7 @@ setVerifyEmailState: (state: {code: string} | undefined) => void } const Context = React.createContext({} as Context) +Context.displayName = 'IntentDialogsContext' export const useIntentDialogs = () => React.useContext(Context) export function Provider({children}: {children: React.ReactNode}) { diff --git a/src/components/moderation/Hider.tsx b/src/components/moderation/Hider.tsx --- a/src/components/moderation/Hider.tsx +++ b/src/components/moderation/Hider.tsx @@ -1,8 +1,8 @@ import React from 'react' -import {ModerationUI} from '@atproto/api' +import {type ModerationUI} from '@atproto/api' import { - ModerationCauseDescription, + type ModerationCauseDescription, useModerationCauseDescription, } from '#/lib/moderation/useModerationCauseDescription' import { @@ -22,6 +22,7 @@ } } const Context = React.createContext({} as Context) +Context.displayName = 'HiderContext' export const useHider = () => React.useContext(Context) diff --git a/src/lib/ScrollContext.tsx b/src/lib/ScrollContext.tsx --- a/src/lib/ScrollContext.tsx +++ b/src/lib/ScrollContext.tsx @@ -1,5 +1,5 @@ -import React, {createContext, useContext, useMemo} from 'react' -import {ScrollHandlers} from 'react-native-reanimated' +import {createContext, useContext, useMemo} from 'react' +import {type ScrollHandlers} from 'react-native-reanimated' const ScrollContext = createContext>({ onBeginDrag: undefined, @@ -7,6 +7,7 @@ onEndDrag: undefined, onScroll: undefined, onMomentumEnd: undefined, }) +ScrollContext.displayName = 'ScrollContext' export function useScrollHandlers(): ScrollHandlers { return useContext(ScrollContext) diff --git a/src/lib/ThemeContext.tsx b/src/lib/ThemeContext.tsx --- a/src/lib/ThemeContext.tsx +++ b/src/lib/ThemeContext.tsx @@ -89,6 +89,7 @@ theme: ThemeName } export const ThemeContext = createContext(defaultTheme) +ThemeContext.displayName = 'ThemeContext' export const useTheme = () => useContext(ThemeContext) diff --git a/src/lib/hooks/useEnableKeyboardController.tsx b/src/lib/hooks/useEnableKeyboardController.tsx --- a/src/lib/hooks/useEnableKeyboardController.tsx +++ b/src/lib/hooks/useEnableKeyboardController.tsx @@ -19,6 +19,8 @@ }>({ incrementRefCount: () => {}, decrementRefCount: () => {}, }) +KeyboardControllerRefCountContext.displayName = + 'KeyboardControllerRefCountContext' export function KeyboardControllerProvider({ children, diff --git a/src/lib/hooks/useHideBottomBarBorder.tsx b/src/lib/hooks/useHideBottomBarBorder.tsx --- a/src/lib/hooks/useHideBottomBarBorder.tsx +++ b/src/lib/hooks/useHideBottomBarBorder.tsx @@ -4,8 +4,11 @@ type HideBottomBarBorderSetter = () => () => void const HideBottomBarBorderContext = createContext(false) +HideBottomBarBorderContext.displayName = 'HideBottomBarBorderContext' const HideBottomBarBorderSetterContext = createContext(null) +HideBottomBarBorderSetterContext.displayName = + 'HideBottomBarBorderSetterContext' export function useHideBottomBarBorderSetter() { const hideBottomBarBorder = useContext(HideBottomBarBorderSetterContext) diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx --- a/src/lib/statsig/statsig.tsx +++ b/src/lib/statsig/statsig.tsx @@ -147,6 +147,7 @@ // We roll our own cache in front of Statsig because it is a singleton // and it's been difficult to get it to behave in a predictable way. // Our own cache ensures consistent evaluation within a single session. const GateCache = React.createContext | null>(null) +GateCache.displayName = 'StatsigGateCacheContext' type GateOptions = { dangerouslyDisableExposureLogging?: boolean diff --git a/src/screens/Onboarding/StepProfile/index.tsx b/src/screens/Onboarding/StepProfile/index.tsx --- a/src/screens/Onboarding/StepProfile/index.tsx +++ b/src/screens/Onboarding/StepProfile/index.tsx @@ -59,6 +59,7 @@ setAvatar: React.Dispatch> } const AvatarContext = React.createContext({} as IAvatarContext) +AvatarContext.displayName = 'AvatarContext' export const useAvatar = () => React.useContext(AvatarContext) const randomColor = diff --git a/src/screens/Onboarding/state.ts b/src/screens/Onboarding/state.ts --- a/src/screens/Onboarding/state.ts +++ b/src/screens/Onboarding/state.ts @@ -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 @@ }>({ state: {...initialState}, dispatch: () => {}, }) +Context.displayName = 'OnboardingContext' export function reducer( s: OnboardingState, diff --git a/src/screens/Settings/components/SettingsList.tsx b/src/screens/Settings/components/SettingsList.tsx --- a/src/screens/Settings/components/SettingsList.tsx +++ b/src/screens/Settings/components/SettingsList.tsx @@ -18,6 +18,7 @@ const ItemContext = createContext({ destructive: false, withinGroup: false, }) +ItemContext.displayName = 'SettingsListItemContext' const Portal = createPortalGroup() diff --git a/src/screens/Signup/state.ts b/src/screens/Signup/state.ts --- a/src/screens/Signup/state.ts +++ b/src/screens/Signup/state.ts @@ -246,6 +246,7 @@ state: SignupState dispatch: React.Dispatch } export const SignupContext = React.createContext({} as IContext) +SignupContext.displayName = 'SignupContext' export const useSignupContext = () => React.useContext(SignupContext) export function useSubmitSignup() { diff --git a/src/screens/StarterPack/Wizard/State.tsx b/src/screens/StarterPack/Wizard/State.tsx --- a/src/screens/StarterPack/Wizard/State.tsx +++ b/src/screens/StarterPack/Wizard/State.tsx @@ -45,6 +45,7 @@ const StateContext = React.createContext([ {} as State, (_: Action) => {}, ]) +StateContext.displayName = 'StarterPackWizardStateContext' export const useWizardState = () => React.useContext(StateContext) function reducer(state: State, action: Action): State { diff --git a/src/state/a11y.tsx b/src/state/a11y.tsx --- a/src/state/a11y.tsx +++ b/src/state/a11y.tsx @@ -8,6 +8,7 @@ const Context = React.createContext({ reduceMotionEnabled: false, screenReaderEnabled: false, }) +Context.displayName = 'A11yContext' export function useA11y() { return React.useContext(Context) diff --git a/src/state/ageAssurance/index.tsx b/src/state/ageAssurance/index.tsx --- a/src/state/ageAssurance/index.tsx +++ b/src/state/ageAssurance/index.tsx @@ -28,11 +28,13 @@ isReady: false, lastInitiatedAt: undefined, isAgeRestricted: false, }) +AgeAssuranceContext.displayName = 'AgeAssuranceContext' const AgeAssuranceAPIContext = createContext({ // @ts-ignore can't be bothered to type this refetch: () => Promise.resolve(), }) +AgeAssuranceAPIContext.displayName = 'AgeAssuranceAPIContext' /** * Low-level provider for fetching age assurance state on app load. Do not add diff --git a/src/state/cache/thread-mutes.tsx b/src/state/cache/thread-mutes.tsx --- a/src/state/cache/thread-mutes.tsx +++ b/src/state/cache/thread-mutes.tsx @@ -7,9 +7,11 @@ type StateContext = Map type SetStateContext = (uri: string, value: boolean) => void const stateContext = React.createContext(new Map()) +stateContext.displayName = 'ThreadMutesStateContext' const setStateContext = React.createContext( (_: string) => false, ) +setStateContext.displayName = 'ThreadMutesSetStateContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(() => new Map()) diff --git a/src/state/dialogs/index.tsx b/src/state/dialogs/index.tsx --- a/src/state/dialogs/index.tsx +++ b/src/state/dialogs/index.tsx @@ -26,10 +26,12 @@ setFullyExpandedCount: React.Dispatch> } const DialogContext = React.createContext({} as IDialogContext) +DialogContext.displayName = 'DialogContext' const DialogControlContext = React.createContext( {} as IDialogControlContext, ) +DialogControlContext.displayName = 'DialogControlContext' /** * The number of dialogs that are fully expanded. This is used to determine the background color of the status bar @@ -107,3 +109,4 @@ ) } +Provider.displayName = 'DialogsProvider' diff --git a/src/state/feed-feedback.tsx b/src/state/feed-feedback.tsx --- a/src/state/feed-feedback.tsx +++ b/src/state/feed-feedback.tsx @@ -35,6 +35,7 @@ onItemSeen: (_item: any) => {}, sendInteraction: (_interaction: AppBskyFeedDefs.Interaction) => {}, feedDescriptor: undefined, }) +stateContext.displayName = 'FeedFeedbackContext' export function useFeedFeedback( feed: FeedDescriptor | undefined, diff --git a/src/state/geolocation.tsx b/src/state/geolocation.tsx --- a/src/state/geolocation.tsx +++ b/src/state/geolocation.tsx @@ -154,6 +154,7 @@ const context = React.createContext({ geolocation: DEFAULT_GEOLOCATION, }) +context.displayName = 'GeolocationContext' export function Provider({children}: {children: React.ReactNode}) { const [geolocation, setGeolocation] = React.useState(() => { diff --git a/src/state/global-gesture-events/index.tsx b/src/state/global-gesture-events/index.tsx --- a/src/state/global-gesture-events/index.tsx +++ b/src/state/global-gesture-events/index.tsx @@ -25,6 +25,7 @@ events: new EventEmitter(), register: () => {}, unregister: () => {}, }) +Context.displayName = 'GlobalGestureEventsContext' export function GlobalGestureEventsProvider({ children, diff --git a/src/state/home-badge.tsx b/src/state/home-badge.tsx --- a/src/state/home-badge.tsx +++ b/src/state/home-badge.tsx @@ -4,7 +4,9 @@ type StateContext = boolean type ApiContext = (hasNew: boolean) => void const stateContext = React.createContext(false) +stateContext.displayName = 'HomeBadgeStateContext' const apiContext = React.createContext((_: boolean) => {}) +apiContext.displayName = 'HomeBadgeApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(false) diff --git a/src/state/invites.tsx b/src/state/invites.tsx --- a/src/state/invites.tsx +++ b/src/state/invites.tsx @@ -10,9 +10,11 @@ const stateContext = React.createContext( persisted.defaults.invites, ) +stateContext.displayName = 'InvitesStateContext' const apiContext = React.createContext({ setInviteCopied(_: string) {}, }) +apiContext.displayName = 'InvitesApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('invites')) diff --git a/src/state/lightbox.tsx b/src/state/lightbox.tsx --- a/src/state/lightbox.tsx +++ b/src/state/lightbox.tsx @@ -2,7 +2,7 @@ import React from 'react' import {nanoid} from 'nanoid/non-secure' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' -import {ImageSource} from '#/view/com/lightbox/ImageViewing/@types' +import {type ImageSource} from '#/view/com/lightbox/ImageViewing/@types' export type Lightbox = { id: string @@ -15,6 +15,7 @@ activeLightbox: Lightbox | null }>({ activeLightbox: null, }) +LightboxContext.displayName = 'LightboxContext' const LightboxControlContext = React.createContext<{ openLightbox: (lightbox: Omit) => void @@ -23,6 +24,7 @@ }>({ openLightbox: () => {}, closeLightbox: () => false, }) +LightboxControlContext.displayName = 'LightboxControlContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [activeLightbox, setActiveLightbox] = React.useState( diff --git a/src/state/messages/convo/index.tsx b/src/state/messages/convo/index.tsx --- a/src/state/messages/convo/index.tsx +++ b/src/state/messages/convo/index.tsx @@ -26,6 +26,7 @@ export * from '#/state/messages/convo/util' const ChatContext = React.createContext(null) +ChatContext.displayName = 'ChatContext' export function useConvo() { const ctx = useContext(ChatContext) diff --git a/src/state/messages/current-convo-id.tsx b/src/state/messages/current-convo-id.tsx --- a/src/state/messages/current-convo-id.tsx +++ b/src/state/messages/current-convo-id.tsx @@ -7,6 +7,7 @@ }>({ currentConvoId: undefined, setCurrentConvoId: () => {}, }) +CurrentConvoIdContext.displayName = 'CurrentConvoIdContext' export function useCurrentConvoId() { const ctx = React.useContext(CurrentConvoIdContext) diff --git a/src/state/messages/events/index.tsx b/src/state/messages/events/index.tsx --- a/src/state/messages/events/index.tsx +++ b/src/state/messages/events/index.tsx @@ -7,6 +7,7 @@ const MessagesEventBusContext = React.createContext( null, ) +MessagesEventBusContext.displayName = 'MessagesEventBusContext' export function useMessagesEventBus() { const ctx = React.useContext(MessagesEventBusContext) diff --git a/src/state/messages/message-drafts.tsx b/src/state/messages/message-drafts.tsx --- a/src/state/messages/message-drafts.tsx +++ b/src/state/messages/message-drafts.tsx @@ -6,6 +6,7 @@ const MessageDraftsContext = React.createContext<{ state: State dispatch: React.Dispatch } | null>(null) +MessageDraftsContext.displayName = 'MessageDraftsContext' function useMessageDraftsContext() { const ctx = React.useContext(MessageDraftsContext) diff --git a/src/state/modals/index.tsx b/src/state/modals/index.tsx --- a/src/state/modals/index.tsx +++ b/src/state/modals/index.tsx @@ -70,6 +70,7 @@ }>({ isModalActive: false, activeModals: [], }) +ModalContext.displayName = 'ModalContext' const ModalControlContext = React.createContext<{ openModal: (modal: Modal) => void @@ -80,6 +81,7 @@ openModal: () => {}, closeModal: () => false, closeAllModals: () => false, }) +ModalControlContext.displayName = 'ModalControlContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [activeModals, setActiveModals] = React.useState([]) diff --git a/src/state/preferences/alt-text-required.tsx b/src/state/preferences/alt-text-required.tsx --- a/src/state/preferences/alt-text-required.tsx +++ b/src/state/preferences/alt-text-required.tsx @@ -8,9 +8,11 @@ const stateContext = React.createContext( persisted.defaults.requireAltTextEnabled, ) +stateContext.displayName = 'AltTextRequiredStateContext' const setContext = React.createContext( (_: persisted.Schema['requireAltTextEnabled']) => {}, ) +setContext.displayName = 'AltTextRequiredSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState( diff --git a/src/state/preferences/autoplay.tsx b/src/state/preferences/autoplay.tsx --- a/src/state/preferences/autoplay.tsx +++ b/src/state/preferences/autoplay.tsx @@ -8,7 +8,9 @@ const stateContext = React.createContext( Boolean(persisted.defaults.disableAutoplay), ) +stateContext.displayName = 'AutoplayStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'AutoplaySetContext' export function Provider({children}: {children: React.ReactNode}) { const [state, setState] = React.useState( diff --git a/src/state/preferences/disable-haptics.tsx b/src/state/preferences/disable-haptics.tsx --- a/src/state/preferences/disable-haptics.tsx +++ b/src/state/preferences/disable-haptics.tsx @@ -8,7 +8,9 @@ const stateContext = React.createContext( Boolean(persisted.defaults.disableHaptics), ) +stateContext.displayName = 'DisableHapticsStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'DisableHapticsSetContext' export function Provider({children}: {children: React.ReactNode}) { const [state, setState] = React.useState( diff --git a/src/state/preferences/external-embeds-prefs.tsx b/src/state/preferences/external-embeds-prefs.tsx --- a/src/state/preferences/external-embeds-prefs.tsx +++ b/src/state/preferences/external-embeds-prefs.tsx @@ -1,6 +1,6 @@ import React from 'react' -import {EmbedPlayerSource} from '#/lib/strings/embed-player' +import {type EmbedPlayerSource} from '#/lib/strings/embed-player' import * as persisted from '#/state/persisted' type StateContext = persisted.Schema['externalEmbeds'] @@ -12,7 +12,9 @@ const stateContext = React.createContext( persisted.defaults.externalEmbeds, ) +stateContext.displayName = 'ExternalEmbedsPrefsStateContext' const setContext = React.createContext({} as SetContext) +setContext.displayName = 'ExternalEmbedsPrefsSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('externalEmbeds')) diff --git a/src/state/preferences/hidden-posts.tsx b/src/state/preferences/hidden-posts.tsx --- a/src/state/preferences/hidden-posts.tsx +++ b/src/state/preferences/hidden-posts.tsx @@ -14,10 +14,12 @@ const stateContext = React.createContext( persisted.defaults.hiddenPosts, ) +stateContext.displayName = 'HiddenPostsStateContext' const apiContext = React.createContext({ hidePost: () => {}, unhidePost: () => {}, }) +apiContext.displayName = 'HiddenPostsApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('hiddenPosts')) diff --git a/src/state/preferences/in-app-browser.tsx b/src/state/preferences/in-app-browser.tsx --- a/src/state/preferences/in-app-browser.tsx +++ b/src/state/preferences/in-app-browser.tsx @@ -8,9 +8,11 @@ const stateContext = React.createContext( persisted.defaults.useInAppBrowser, ) +stateContext.displayName = 'InAppBrowserStateContext' const setContext = React.createContext( (_: persisted.Schema['useInAppBrowser']) => {}, ) +setContext.displayName = 'InAppBrowserSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('useInAppBrowser')) diff --git a/src/state/preferences/kawaii.tsx b/src/state/preferences/kawaii.tsx --- a/src/state/preferences/kawaii.tsx +++ b/src/state/preferences/kawaii.tsx @@ -8,6 +8,7 @@ const stateContext = React.createContext( persisted.defaults.kawaii, ) +stateContext.displayName = 'KawaiiStateContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('kawaii')) diff --git a/src/state/preferences/label-defs.tsx b/src/state/preferences/label-defs.tsx --- a/src/state/preferences/label-defs.tsx +++ b/src/state/preferences/label-defs.tsx @@ -1,5 +1,8 @@ import React from 'react' -import {AppBskyLabelerDefs, InterpretedLabelValueDefinition} from '@atproto/api' +import { + type AppBskyLabelerDefs, + type InterpretedLabelValueDefinition, +} from '@atproto/api' import {useLabelDefinitionsQuery} from '../queries/preferences' @@ -12,6 +15,7 @@ const stateContext = React.createContext({ labelDefs: {}, labelers: [], }) +stateContext.displayName = 'LabelDefsStateContext' export function Provider({children}: React.PropsWithChildren<{}>) { const state = useLabelDefinitionsQuery() diff --git a/src/state/preferences/languages.tsx b/src/state/preferences/languages.tsx --- a/src/state/preferences/languages.tsx +++ b/src/state/preferences/languages.tsx @@ -1,6 +1,6 @@ import React from 'react' -import {AppLanguage} from '#/locale/languages' +import {type AppLanguage} from '#/locale/languages' import * as persisted from '#/state/persisted' type SetStateCb = ( @@ -20,6 +20,7 @@ const stateContext = React.createContext( persisted.defaults.languagePrefs, ) +stateContext.displayName = 'LanguagePrefsStateContext' const apiContext = React.createContext({ setPrimaryLanguage: (_: string) => {}, setPostLanguage: (_: string) => {}, @@ -29,6 +30,7 @@ togglePostLanguage: (_: string) => {}, savePostLanguageToHistory: () => {}, setAppLanguage: (_: AppLanguage) => {}, }) +apiContext.displayName = 'LanguagePrefsApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(persisted.get('languagePrefs')) diff --git a/src/state/preferences/large-alt-badge.tsx b/src/state/preferences/large-alt-badge.tsx --- a/src/state/preferences/large-alt-badge.tsx +++ b/src/state/preferences/large-alt-badge.tsx @@ -8,9 +8,11 @@ const stateContext = React.createContext( persisted.defaults.largeAltBadgeEnabled, ) +stateContext.displayName = 'LargeAltBadgeStateContext' const setContext = React.createContext( (_: persisted.Schema['largeAltBadgeEnabled']) => {}, ) +setContext.displayName = 'LargeAltBadgeSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState( diff --git a/src/state/preferences/moderation-opts.tsx b/src/state/preferences/moderation-opts.tsx --- a/src/state/preferences/moderation-opts.tsx +++ b/src/state/preferences/moderation-opts.tsx @@ -1,5 +1,5 @@ -import React, {createContext, useContext, useMemo} from 'react' -import {BskyAgent, ModerationOpts} from '@atproto/api' +import {createContext, useContext, useMemo} from 'react' +import {BskyAgent, type ModerationOpts} from '@atproto/api' import {useHiddenPosts, useLabelDefinitions} from '#/state/preferences' import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation' @@ -9,11 +9,13 @@ export const moderationOptsContext = createContext( undefined, ) +moderationOptsContext.displayName = 'ModerationOptsContext' // used in the moderation state devtool export const moderationOptsOverrideContext = createContext< ModerationOpts | undefined >(undefined) +moderationOptsOverrideContext.displayName = 'ModerationOptsOverrideContext' export function useModerationOpts() { return useContext(moderationOptsContext) diff --git a/src/state/preferences/subtitles.tsx b/src/state/preferences/subtitles.tsx --- a/src/state/preferences/subtitles.tsx +++ b/src/state/preferences/subtitles.tsx @@ -8,7 +8,9 @@ const stateContext = React.createContext( Boolean(persisted.defaults.subtitlesEnabled), ) +stateContext.displayName = 'SubtitlesStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'SubtitlesSetContext' export function Provider({children}: {children: React.ReactNode}) { const [state, setState] = React.useState( diff --git a/src/state/preferences/trending.tsx b/src/state/preferences/trending.tsx --- a/src/state/preferences/trending.tsx +++ b/src/state/preferences/trending.tsx @@ -22,10 +22,12 @@ const StateContext = React.createContext({ trendingDisabled: Boolean(persisted.defaults.trendingDisabled), trendingVideoDisabled: Boolean(persisted.defaults.trendingVideoDisabled), }) +StateContext.displayName = 'TrendingStateContext' const ApiContext = React.createContext({ setTrendingDisabled() {}, setTrendingVideoDisabled() {}, }) +ApiContext.displayName = 'TrendingApiContext' function usePersistedBooleanValue(key: T) { const [value, _set] = React.useState(() => { diff --git a/src/state/preferences/used-starter-packs.tsx b/src/state/preferences/used-starter-packs.tsx --- a/src/state/preferences/used-starter-packs.tsx +++ b/src/state/preferences/used-starter-packs.tsx @@ -6,7 +6,9 @@ type StateContext = boolean | undefined type SetContext = (v: boolean) => void const stateContext = React.createContext(false) +stateContext.displayName = 'UsedStarterPacksStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'UsedStarterPacksSetContext' export function Provider({children}: {children: React.ReactNode}) { const [state, setState] = React.useState(() => diff --git a/src/state/queries/messages/list-conversations.tsx b/src/state/queries/messages/list-conversations.tsx --- a/src/state/queries/messages/list-conversations.tsx +++ b/src/state/queries/messages/list-conversations.tsx @@ -62,6 +62,7 @@ const ListConvosContext = createContext<{ accepted: ChatBskyConvoDefs.ConvoView[] request: ChatBskyConvoDefs.ConvoView[] } | null>(null) +ListConvosContext.displayName = 'ListConvosContext' export function useListConvos() { const ctx = useContext(ListConvosContext) diff --git a/src/state/queries/notifications/unread.tsx b/src/state/queries/notifications/unread.tsx --- a/src/state/queries/notifications/unread.tsx +++ b/src/state/queries/notifications/unread.tsx @@ -35,12 +35,14 @@ getCachedUnreadPage: () => FeedPage | undefined } const stateContext = React.createContext('') +stateContext.displayName = 'NotificationsUnreadStateContext' const apiContext = React.createContext({ async markAllRead() {}, async checkUnread() {}, getCachedUnreadPage: () => undefined, }) +apiContext.displayName = 'NotificationsUnreadApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const {hasSession} = useSession() diff --git a/src/state/service-config.tsx b/src/state/service-config.tsx --- a/src/state/service-config.tsx +++ b/src/state/service-config.tsx @@ -16,8 +16,10 @@ const TrendingContext = createContext({ enabled: false, }) +TrendingContext.displayName = 'TrendingContext' const LiveNowContext = createContext(null) +LiveNowContext.displayName = 'LiveNowContext' export function Provider({children}: {children: React.ReactNode}) { const langPrefs = useLanguagePrefs() diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx --- a/src/state/session/index.tsx +++ b/src/state/session/index.tsx @@ -30,8 +30,10 @@ accounts: [], currentAccount: undefined, hasSession: false, }) +StateContext.displayName = 'SessionStateContext' const AgentContext = React.createContext(null) +AgentContext.displayName = 'SessionAgentContext' const ApiContext = React.createContext({ createAccount: async () => {}, @@ -42,6 +44,7 @@ resumeSession: async () => {}, removeAccount: () => {}, partialRefreshSession: async () => {}, }) +ApiContext.displayName = 'SessionApiContext' export function Provider({children}: React.PropsWithChildren<{}>) { const cancelPendingTask = useOneTaskAtATime() diff --git a/src/state/shell/color-mode.tsx b/src/state/shell/color-mode.tsx --- a/src/state/shell/color-mode.tsx +++ b/src/state/shell/color-mode.tsx @@ -15,7 +15,9 @@ const stateContext = React.createContext({ colorMode: 'system', darkTheme: 'dark', }) +stateContext.displayName = 'ColorModeStateContext' const setContext = React.createContext({} as SetContext) +setContext.displayName = 'ColorModeSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [colorMode, setColorMode] = React.useState(persisted.get('colorMode')) diff --git a/src/state/shell/composer/index.tsx b/src/state/shell/composer/index.tsx --- a/src/state/shell/composer/index.tsx +++ b/src/state/shell/composer/index.tsx @@ -51,12 +51,14 @@ closeComposer: () => boolean } const stateContext = React.createContext(undefined) +stateContext.displayName = 'ComposerStateContext' const controlsContext = React.createContext({ openComposer(_opts: ComposerOpts) {}, closeComposer() { return false }, }) +controlsContext.displayName = 'ComposerControlsContext' export function Provider({children}: React.PropsWithChildren<{}>) { const {_} = useLingui() diff --git a/src/state/shell/drawer-open.tsx b/src/state/shell/drawer-open.tsx --- a/src/state/shell/drawer-open.tsx +++ b/src/state/shell/drawer-open.tsx @@ -4,7 +4,9 @@ type StateContext = boolean type SetContext = (v: boolean) => void const stateContext = React.createContext(false) +stateContext.displayName = 'DrawerOpenStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'DrawerOpenSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(false) diff --git a/src/state/shell/drawer-swipe-disabled.tsx b/src/state/shell/drawer-swipe-disabled.tsx --- a/src/state/shell/drawer-swipe-disabled.tsx +++ b/src/state/shell/drawer-swipe-disabled.tsx @@ -4,7 +4,9 @@ type StateContext = boolean type SetContext = (v: boolean) => void const stateContext = React.createContext(false) +stateContext.displayName = 'DrawerSwipeDisabledStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'DrawerSwipeDisabledSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [state, setState] = React.useState(false) diff --git a/src/state/shell/logged-out.tsx b/src/state/shell/logged-out.tsx --- a/src/state/shell/logged-out.tsx +++ b/src/state/shell/logged-out.tsx @@ -39,12 +39,14 @@ const StateContext = React.createContext({ showLoggedOut: false, requestedAccountSwitchTo: undefined, }) +StateContext.displayName = 'LoggedOutStateContext' const ControlsContext = React.createContext({ setShowLoggedOut: () => {}, requestSwitchToAccount: () => {}, clearRequestedAccount: () => {}, }) +ControlsContext.displayName = 'LoggedOutControlsContext' export function Provider({children}: React.PropsWithChildren<{}>) { const activeStarterPack = useActiveStarterPack() diff --git a/src/state/shell/minimal-mode.tsx b/src/state/shell/minimal-mode.tsx --- a/src/state/shell/minimal-mode.tsx +++ b/src/state/shell/minimal-mode.tsx @@ -1,5 +1,9 @@ import React from 'react' -import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated' +import { + type SharedValue, + useSharedValue, + withSpring, +} from 'react-native-reanimated' type StateContext = { headerMode: SharedValue @@ -29,7 +33,9 @@ }, set() {}, }, }) +stateContext.displayName = 'MinimalModeStateContext' const setContext = React.createContext((_: boolean) => {}) +setContext.displayName = 'MinimalModeSetContext' export function Provider({children}: React.PropsWithChildren<{}>) { const headerMode = useSharedValue(0) diff --git a/src/state/shell/onboarding.tsx b/src/state/shell/onboarding.tsx --- a/src/state/shell/onboarding.tsx +++ b/src/state/shell/onboarding.tsx @@ -29,7 +29,9 @@ const stateContext = React.createContext( compute(persisted.defaults.onboarding), ) +stateContext.displayName = 'OnboardingStateContext' const dispatchContext = React.createContext((_: Action) => {}) +dispatchContext.displayName = 'OnboardingDispatchContext' function reducer(state: StateContext, action: Action): StateContext { switch (action.type) { diff --git a/src/state/shell/post-progress.tsx b/src/state/shell/post-progress.tsx --- a/src/state/shell/post-progress.tsx +++ b/src/state/shell/post-progress.tsx @@ -10,6 +10,7 @@ const PostProgressContext = React.createContext({ progress: 0, status: 'idle', }) +PostProgressContext.displayName = 'PostProgressContext' export function Provider() {} diff --git a/src/state/shell/progress-guide.tsx b/src/state/shell/progress-guide.tsx --- a/src/state/shell/progress-guide.tsx +++ b/src/state/shell/progress-guide.tsx @@ -5,7 +5,7 @@ import {logEvent} from '#/lib/statsig/statsig' import { ProgressGuideToast, - ProgressGuideToastRef, + type ProgressGuideToastRef, } from '#/components/ProgressGuide/Toast' import { usePreferencesQuery, @@ -45,6 +45,7 @@ | Follow10ProgressGuide | undefined const ProgressGuideContext = React.createContext(undefined) +ProgressGuideContext.displayName = 'ProgressGuideContext' const ProgressGuideControlContext = React.createContext<{ startProgressGuide(guide: ProgressGuideName): void @@ -55,6 +56,7 @@ startProgressGuide: (_guide: ProgressGuideName) => {}, endProgressGuide: () => {}, captureAction: (_action: ProgressGuideAction, _count = 1) => {}, }) +ProgressGuideControlContext.displayName = 'ProgressGuideControlContext' export function useProgressGuide(guide: ProgressGuideName) { const ctx = React.useContext(ProgressGuideContext) diff --git a/src/state/shell/selected-feed.tsx b/src/state/shell/selected-feed.tsx --- a/src/state/shell/selected-feed.tsx +++ b/src/state/shell/selected-feed.tsx @@ -2,13 +2,15 @@ import React from 'react' import {isWeb} from '#/platform/detection' import * as persisted from '#/state/persisted' -import {FeedDescriptor} from '#/state/queries/post-feed' +import {type FeedDescriptor} from '#/state/queries/post-feed' type StateContext = FeedDescriptor | null type SetContext = (v: FeedDescriptor) => void const stateContext = React.createContext(null) +stateContext.displayName = 'SelectedFeedStateContext' const setContext = React.createContext((_: string) => {}) +setContext.displayName = 'SelectedFeedSetContext' function getInitialFeed(): FeedDescriptor | null { if (isWeb) { diff --git a/src/state/shell/shell-layout.tsx b/src/state/shell/shell-layout.tsx --- a/src/state/shell/shell-layout.tsx +++ b/src/state/shell/shell-layout.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {SharedValue, useSharedValue} from 'react-native-reanimated' +import {type SharedValue, useSharedValue} from 'react-native-reanimated' type StateContext = { headerHeight: SharedValue @@ -28,6 +28,7 @@ }, set() {}, }, }) +stateContext.displayName = 'ShellLayoutContext' export function Provider({children}: React.PropsWithChildren<{}>) { const headerHeight = useSharedValue(0) diff --git a/src/state/shell/starter-pack.tsx b/src/state/shell/starter-pack.tsx --- a/src/state/shell/starter-pack.tsx +++ b/src/state/shell/starter-pack.tsx @@ -9,7 +9,9 @@ | undefined type SetContext = (v: StateContext) => void const stateContext = React.createContext(undefined) +stateContext.displayName = 'ActiveStarterPackStateContext' const setContext = React.createContext((_: StateContext) => {}) +setContext.displayName = 'ActiveStarterPackSetContext' export function Provider({children}: {children: React.ReactNode}) { const [state, setState] = React.useState() diff --git a/src/state/shell/tick-every-minute.tsx b/src/state/shell/tick-every-minute.tsx --- a/src/state/shell/tick-every-minute.tsx +++ b/src/state/shell/tick-every-minute.tsx @@ -3,6 +3,7 @@ type StateContext = number const stateContext = React.createContext(0) +stateContext.displayName = 'TickEveryMinuteContext' export function Provider({children}: React.PropsWithChildren<{}>) { const [tick, setTick] = React.useState(Date.now()) diff --git a/src/state/threadgate-hidden-replies.tsx b/src/state/threadgate-hidden-replies.tsx --- a/src/state/threadgate-hidden-replies.tsx +++ b/src/state/threadgate-hidden-replies.tsx @@ -14,11 +14,13 @@ const StateContext = React.createContext({ uris: new Set(), recentlyUnhiddenUris: new Set(), }) +StateContext.displayName = 'ThreadgateHiddenRepliesStateContext' const ApiContext = React.createContext({ addHiddenReplyUri: () => {}, removeHiddenReplyUri: () => {}, }) +ApiContext.displayName = 'ThreadgateHiddenRepliesApiContext' export function Provider({children}: {children: React.ReactNode}) { const [uris, setHiddenReplyUris] = React.useState>(new Set()) diff --git a/src/view/com/pager/PagerHeaderContext.tsx b/src/view/com/pager/PagerHeaderContext.tsx --- a/src/view/com/pager/PagerHeaderContext.tsx +++ b/src/view/com/pager/PagerHeaderContext.tsx @@ -1,5 +1,5 @@ import React, {useContext} from 'react' -import {SharedValue} from 'react-native-reanimated' +import {type SharedValue} from 'react-native-reanimated' import {isNative} from '#/platform/detection' @@ -7,6 +7,7 @@ export const PagerHeaderContext = React.createContext<{ scrollY: SharedValue headerHeight: number } | null>(null) +PagerHeaderContext.displayName = 'PagerHeaderContext' /** * Passes information about the scroll position and header height down via