Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(mobile): files, review and remaining settings screens compile with the React Compiler #21124

Mergedjuliusmarmingemerged 3 commits intoperf/mobile-compile-1 fromrefs/pull/21124/headmerged by juliusmarminge View on GitHub

Showing 14 changed files with 90 additions and 113 deletions (loading 13).

x
0 of 14 viewed, 14 left
90 additions and 113 deletionsapps/mobile/src/features/files/AttachmentFileScreen.tsxModified
View file
@@ -6,7 +6,7 @@
import type { MenuAction } from "@react-native-menu/menu";
import { EnvironmentId } from "@t3tools/contracts";
import { formatAttachmentSize } from "@t3tools/client-runtime/state/attachments";
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import { useEffect, useRef, useState } from "react";
import { Platform, ScrollView, View } from "react-native";
​
import {
@@ -196,9 +196,9 @@
const [nativeError, setNativeError] = useState<string | null>(null);
const pendingNativeError = useRef<string | null>(null);
- const handleBack = useCallback(() => {
+ const handleBack = () => {
if (navigation.canGoBack()) navigation.goBack();
- }, [navigation]);
+ };
const { uri, resource } = document;
useEffect(() => {
if (nativeViewer !== "pending" || !uri) return;
@@ -208,17 +208,17 @@
}, [nativeViewer, uri]);
// The viewer mints its own fresh URL from the resource, so a link that expired while this
// screen sat in the background is never handed to Quick Look or ACTION_VIEW.
- const nativeSource = useMemo<FilePreviewSource | null>(() => {
+ const nativeSource = ((): FilePreviewSource | null => {
const kind = nativeKind ?? "document";