Skip to content

Commit

Permalink
fix(Logcat): 移除不必要的引用,启用列表反转
Browse files Browse the repository at this point in the history
  • Loading branch information
thoulee21 committed Jan 8, 2025
1 parent cdf8978 commit f7cbf0f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/pages/logcat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import React, {
useEffect,
useLayoutEffect,
useMemo,
useRef,
useState,
useState
} from 'react';
import {
Animated,
Expand Down Expand Up @@ -36,7 +35,6 @@ import { logFilePath, rootLog } from '../utils/logger';

export const Logcat = () => {
const navigation = useNavigation();
const logRef = useRef<Animated.FlatList>(null);
const appTheme = useTheme();

const [isLoaded, setIsLoaded] = useState(false);
Expand Down Expand Up @@ -152,8 +150,8 @@ export const Logcat = () => {
return (
<>
<Animated.FlatList
ref={logRef}
data={logLines}
inverted
style={styles.root}
contentContainerStyle={styles.content}
renderItem={renderLogLine}
Expand All @@ -170,9 +168,6 @@ export const Logcat = () => {
}
ListEmptyComponent={renderEmpty}
persistentScrollbar
onLayout={() => {
logRef.current?.scrollToEnd();
}}
/>

<Portal>
Expand Down

0 comments on commit f7cbf0f

Please sign in to comment.