@devries-cameron20 / t3code Mirror · read-only / commits / d487078f11
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 15:45 UTC

chore(lint): enforce react/memo-dependencies (#25117)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 25, 2026 at 20:23 UTC d487078f11f80543da83e5316a82d43b0a8addbb
9 files changed +14 -19
apps/mobile/src/components/ui/AndroidAnchoredMenu.tsx
+3 -2
@@ -125,6 +125,7 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
125 const maxHeight = Math.min(opensDown ? spaceBelow : spaceAbove, 480);
126 const placeable = local !== null && rootHeight !== null;
127
128 + const { onPressAction } = props;
129 const onPressItem = useCallback(
130 (action: MenuAction) => {
131 if ((action.subactions?.length ?? 0) > 0) {
@@ -133,12 +134,12 @@ export function AndroidAnchoredMenu(props: AndroidAnchoredMenuProps) {
134 }
135 close();
136 if (action.id !== undefined) {
136 - props.onPressAction?.({
137 + onPressAction?.({
138 nativeEvent: { event: action.id },
139 } as Parameters<NonNullable<MenuComponentProps["onPressAction"]>>[0]);
140 }
141 },
141 - [close, props.onPressAction],
142 + [close, onPressAction],
143 );
144
145 return (
apps/mobile/src/features/keyboard/HardwareKeyboardCommandProvider.tsx
+1
@@ -119,6 +119,7 @@ export function HardwareKeyboardCommandProvider({
119 if (pathname.split("/")[4] !== "terminal") commands.add("copyThreadReference");
120 }
121 return [...commands];
122 + // oxlint-disable-next-line react/memo-dependencies -- registrationVersion invalidates the snapshot of the external keyboard-command registry.
123 }, [activeThreadRef, pathname, registrationVersion, navigation]);
124
125 const onCommand = useCallback(
apps/mobile/src/features/settings/scheduled-task-editor.tsx
+2 -11
@@ -77,7 +77,7 @@ export function useScheduledTaskEditor() {
77 [defaultEditor],
78 );
79 const startEditor = startScheduledTaskEditor;
80 - const resetEditor = useCallback(() => startEditor(defaultEditor), [defaultEditor, startEditor]);
80 + const resetEditor = useCallback(() => startEditor(defaultEditor), [defaultEditor]);
81 const readEditor = useCallback(
82 () => readScheduledTaskEditor(voiceOwnerKey, defaultEditor),
83 [defaultEditor, voiceOwnerKey],
@@ -93,15 +93,6 @@ export function useScheduledTaskEditor() {
93 resetEditor,
94 draftForEnvironment,
95 }),
96 - [
97 - editor,
98 - voiceOwnerKey,
99 - readEditor,
100 - setEditor,
101 - startEditor,
102 - hasChanges,
103 - resetEditor,
104 - draftForEnvironment,
105 - ],
96 + [editor, voiceOwnerKey, readEditor, setEditor, hasChanges, resetEditor, draftForEnvironment],
97 );
98 }
apps/mobile/src/features/threads/ThreadArrangementSheet.tsx
+1 -1
@@ -115,7 +115,7 @@ function DragHandle(props: {
115 .onUpdate((event) => latest.current.onMove(event.translationY))
116 .onEnd((event) => latest.current.onMove(event.translationY))
117 .onFinalize((_, success) => latest.current.onEnd(!success)),
118 - [props.disabled],
118 + [props.disabled, latest],
119 );
120 return (
121 <GestureDetector gesture={gesture}>
apps/mobile/src/features/threads/ThreadFeed.tsx
+1
@@ -596,6 +596,7 @@ function MessageAttachmentFile(props: {
596 openingRef.current?.abort();
597 openingRef.current = null;
598 };
599 + // oxlint-disable-next-line react/memo-dependencies -- Changing the attachment or connection cancels the previous file open even while this screen stays focused.
600 }, [props.environmentId, attachment.id, httpBaseUrl]),
601 );
602
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+1 -1
@@ -731,6 +731,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
731 });
732 const snoozePresets = useMemo(
733 () => (swipeActions.secondary === "snooze" ? resolveSnoozePresets(new Date()) : ([] as const)),
734 + // oxlint-disable-next-line react/memo-dependencies -- The minute tick refreshes relative snooze times while the row remains mounted.
735 [props.snoozePresetMinute, swipeActions.secondary],
736 );
737 const snoozePresetActions = useMemo<MenuAction[]>(
@@ -777,7 +778,6 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
778 props.reorderSupported,
779 props.pinningSupported,
780 thread.pinnedAt,
780 - variant,
781 ],
782 );
783 const autoSettleMenuItems = useMemo<MenuAction[]>(
apps/mobile/src/native/T3ComposerEditor.ios.tsx
+2 -2
@@ -194,7 +194,7 @@ export function ComposerEditor({
194 };
195 }),
196 );
197 - }, [props.value, props.context, skillLabels, theme, chipTextColor]);
197 + }, [props.value, props.context, skillLabels, theme, chipTextColor, confirmedTokensRef]);
198 // Every render resolves against the snapshot history, so a render whose
199 // (value, selection) lags the acknowledged native state is stamped behind
200 // the native revision and rejected by the editor instead of re-applying a
@@ -254,7 +254,7 @@ export function ComposerEditor({
254 });
255 return acknowledgedEventCount;
256 },
257 - [],
257 + [nativeEventSnapshotsRef],
258 );
259 const themeJson = JSON.stringify(createNativeComposerTheme(theme));
260 const resolvedTextStyle = StyleSheet.flatten(textStyle) ?? {};
apps/mobile/src/native/T3ComposerEditor.native.tsx
+2 -2
@@ -192,7 +192,7 @@ export function ComposerEditor({
192 };
193 }),
194 );
195 - }, [props.value, props.context, skillLabels, theme, chipTextColor]);
195 + }, [props.value, props.context, skillLabels, theme, chipTextColor, confirmedTokensRef]);
196 // Every render resolves against the snapshot history, so a render whose
197 // (value, selection) lags the acknowledged native state is stamped behind
198 // the native revision and rejected by the editor instead of re-applying a
@@ -252,7 +252,7 @@ export function ComposerEditor({
252 });
253 return acknowledgedEventCount;
254 },
255 - [],
255 + [nativeEventSnapshotsRef],
256 );
257 const { systemColorsActive } = useAppearancePreferences();
258 const themeJson = JSON.stringify({
vite.config.ts
+1
@@ -226,6 +226,7 @@ export default defineConfig({
226 "unicorn/no-array-reverse": "off",
227 "react/no-object-type-as-default-prop": "off",
228 "react/jsx-no-constructed-context-values": "off",
229 + "react/memo-dependencies": "error",
230 "react/immutability": "error",
231 "react/no-array-index-key": "error",
232 "react/no-unstable-nested-components": "error",