Skip to content

Commit a9cf5c5

Browse files
chore(lint): enforce react/no-unstable-nested-components
1 parent 54ae29a commit a9cf5c5

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎apps/mobile/src/Stack.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,7 @@ export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navig
10771077
const nativeMetrics = useNativeLayoutMetrics();
10781078
const usesSplitView = deriveLayout({ width, height, nativeMetrics }).usesSplitView;
10791079

1080+
/* oxlint-disable react/no-unstable-nested-components -- React Navigation invokes screenLayout as a render callback. */
10801081
return (
10811082
<Navigator
10821083
screenLayout={(props) => <GuardedScreenLayout {...props} />}
@@ -1087,6 +1088,8 @@ export const RootStack = RootStackConfig.with(function AdaptiveRootStack({ Navig
10871088
}
10881089
/>
10891090
);
1091+
1092+
/* oxlint-enable react/no-unstable-nested-components */
10901093
});
10911094

10921095
type RootStackType = typeof RootStack;

‎apps/mobile/src/features/threads/ThreadRouteScreen.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,14 +558,14 @@ function ThreadRouteContent(
558558
};
559559
const safeAreaInsets = useSafeAreaInsets();
560560
const inspectorHeaderInset = Platform.OS === "ios" ? 0 : safeAreaInsets.top;
561-
const GitInspector = () => (
561+
const renderGitInspector = () => (
562562
<GitOverviewSheet
563563
headerInset={inspectorHeaderInset}
564564
presentation="inspector"
565565
route={{ params: { environmentId: environmentId!, threadId: threadId! } }}
566566
/>
567567
);
568-
const FilesInspector = () =>
568+
const renderFilesInspector = () =>
569569
selectedThread !== null && selectedThreadCwd !== null ? (
570570
<ThreadFileNavigatorPane
571571
cwd={selectedThreadCwd}
@@ -576,7 +576,7 @@ function ThreadRouteContent(
576576
onSelectFile={handleSelectInspectorFile}
577577
/>
578578
) : null;
579-
const RouteInspector = () => props.renderInspector?.(inspectorHeaderInset);
579+
const renderRouteInspector = () => props.renderInspector?.(inspectorHeaderInset);
580580
const renderPreviewInspector = () =>
581581
previewTarget && panes.auxiliaryPaneVisible ? (
582582
<ThreadInspectorPreview
@@ -600,11 +600,11 @@ function ThreadRouteContent(
600600
inspectorMode === null ? null : (
601601
<ThreadInspectorContentStack
602602
renderPreview={renderPreviewInspector}
603-
renderFiles={FilesInspector}
604-
renderGit={GitInspector}
603+
renderFiles={renderFilesInspector}
604+
renderGit={renderGitInspector}
605605
mode={inspectorMode}
606606
resetKeys={[routeThreadIdentity, selectedThreadCwd]}
607-
renderRoute={props.renderInspector ? RouteInspector : undefined}
607+
renderRoute={props.renderInspector ? renderRouteInspector : undefined}
608608
/>
609609
);
610610
const activeInspectorRenderer =

‎vite.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export default defineConfig({
216216
perf: "warn",
217217
},
218218
rules: {
219+
"react/no-unstable-nested-components": "error",
219220
"react/static-components": "error",
220221
"react/capitalized-calls": "error",
221222
"typescript/no-extraneous-class": "error",

0 commit comments

Comments
 (0)