TypeScript
perf(mobile): Connect onboarding compiles with the React Compiler (#20970)
Julius Marmingefe77d643ef8a
diff --git a/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx b/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsxindex d5f77a9cce5..5e3eac56da6 100644--- a/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx+++ b/apps/mobile/src/features/cloud/ConnectOnboardingRouteScreen.tsx@@ -3,7 +3,7 @@ import { ScreenScrollView as ScrollView } from "../../components/ui/ScreenScrollimport { useAuth } from "@clerk/expo";import { StackActions, useNavigation } from "@react-navigation/native";-import { useCallback, useEffect, useState } from "react";+import { useEffect, useState } from "react";import { Platform, Pressable, RefreshControl, View } from "react-native";import { useSafeAreaInsets } from "react-native-safe-area-context";@@ -49,24 +49,18 @@ function ConfiguredConnectOnboardingRouteScreen() {});const [isRefreshing, setIsRefreshing] = useState(false);- const handleRefresh = useCallback(() => {- void (async () => {- setIsRefreshing(true);- try {- await refreshRelayEnvironments();- } finally {- setIsRefreshing(false);- }- })();- }, [refreshRelayEnvironments]);+ const handleRefresh = () => {+ setIsRefreshing(true);+ void refreshRelayEnvironments().finally(() => setIsRefreshing(false));+ };- const handleClose = useCallback(() => {+ const handleClose = () => {navigation.goBack();- }, [navigation]);+ };// Persist before dismissing so a quick sign-out/sign-in cannot race ahead// of the preference write; the write is a local secure-store update.- const handleDontShowAgain = useCallback(() => {+ const handleDontShowAgain = () => {void (async () => {if (userId) {const result = await settlePromise(() => optOutOfConnectOnboarding(userId));@@ -74,7 +68,7 @@ function ConfiguredConnectOnboardingRouteScreen() {}navigation.goBack();})();- }, [navigation, userId]);+ };return (<View collapsable={false} className="flex-1 bg-sheet">diff --git a/apps/mobile/src/reactCompilerCoverage.test.ts b/apps/mobile/src/reactCompilerCoverage.test.tsindex 17034d2b699..d771223712f 100644--- a/apps/mobile/src/reactCompilerCoverage.test.ts+++ b/apps/mobile/src/reactCompilerCoverage.test.ts@@ -25,7 +25,6 @@ const KNOWN_BAILOUTS: Record<string, string> = {"src/components/ui/AndroidAnchoredMenu.tsx": "ref read during render","src/components/ui/Menu.tsx": "ref read during render","src/components/ui/OverlayPortal.tsx": "unsupported syntax",- "src/features/cloud/ConnectOnboardingRouteScreen.tsx": "try without catch","src/features/connection/ConnectionsNewRouteScreen.tsx": "try without catch","src/features/devices/DevicePreviewRouteScreen.tsx": "try without catch","src/features/diffs/nativeReviewDiffSurface.ts": "ref read during render",