Fix <List> types (#6756)

* fix List and ScrollView types

* add comment

* rm omitting ref
This commit is contained in:
Samuel Newman
2024-11-26 15:55:27 +00:00
committed by GitHub
parent 56a88098d2
commit ce1b04b925
10 changed files with 171 additions and 155 deletions
@@ -1,5 +1,5 @@
import React, {useCallback, useRef} from 'react'
import {FlatList, LayoutChangeEvent, View} from 'react-native'
import {LayoutChangeEvent, View} from 'react-native'
import {
KeyboardStickyView,
useKeyboardHandler,
@@ -33,7 +33,7 @@ import {
EmojiPicker,
EmojiPickerState,
} from '#/view/com/composer/text-input/web/EmojiPicker.web'
import {List} from '#/view/com/util/List'
import {List, ListMethods} from '#/view/com/util/List'
import {ChatDisabled} from '#/screens/Messages/components/ChatDisabled'
import {MessageInput} from '#/screens/Messages/components/MessageInput'
import {MessageListError} from '#/screens/Messages/components/MessageListError'
@@ -94,7 +94,7 @@ export function MessagesList({
const getPost = useGetPost()
const {embedUri, setEmbed} = useMessageEmbed()
const flatListRef = useAnimatedRef<FlatList>()
const flatListRef = useAnimatedRef<ListMethods>()
const [newMessagesPill, setNewMessagesPill] = React.useState({
show: false,
+2 -1
View File
@@ -1,5 +1,6 @@
import React from 'react'
import {View} from 'react-native'
import Animated from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
@@ -35,7 +36,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
const {gtMobile} = useBreakpoints()
const onboardDispatch = useOnboardingDispatch()
const {state, dispatch} = React.useContext(Context)
const scrollview = React.useRef<ScrollView>(null)
const scrollview = React.useRef<Animated.ScrollView>(null)
const prevActiveStep = React.useRef<string>(state.activeStep)
React.useEffect(() => {