Enable React Native strict TypeScript API (#11459)

This commit is contained in:
Samuel Newman
2026-08-25 09:40:14 +03:00
committed by GitHub
parent 5f3d24efab
commit f87fdd2ea2
149 changed files with 506 additions and 623 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export function Layout({children}: React.PropsWithChildren<{}>) {
const {gtMobile} = useBreakpoints()
const onboardDispatch = useOnboardingDispatch()
const {state, dispatch} = useOnboardingInternalState()
const scrollview = useRef<ScrollView>(null)
const scrollview = useRef<React.ComponentRef<typeof ScrollView>>(null)
const prevActiveStep = useRef<string>(state.activeStep)
useEffect(() => {
@@ -1,6 +1,7 @@
import {useRef, useState} from 'react'
import {View} from 'react-native'
import PagerView from 'react-native-pager-view'
import {type PagerViewOnPageSelectedEvent} from 'react-native-pager-view'
import {Image} from 'expo-image'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
@@ -36,7 +37,7 @@ export function ValuePropositionPager({
ref={ref}
style={[a.flex_1]}
initialPage={step}
onPageSelected={evt => {
onPageSelected={(evt: PagerViewOnPageSelectedEvent) => {
const page = evt.nativeEvent.position as 0 | 1 | 2
if (step !== page) {
setActivePage(page)
@@ -52,7 +52,6 @@ export const PlaceholderCanvas = forwardRef<PlaceholderCanvasRef, {}>(
<View style={styles.container}>
<Suspense fallback={null}>
<LazyViewShot
// @ts-ignore this library doesn't have types
ref={viewshotRef}
options={{
fileName: 'placeholderAvatar',
@@ -378,7 +378,7 @@ function SuggestedProfileCard({
}) {
const t = useTheme()
const ax = useAnalytics()
const cardRef = useRef<View>(null)
const cardRef = useRef<React.ComponentRef<typeof View>>(null)
const hasTrackedRef = useRef(false)
useEffect(() => {
@@ -396,7 +396,7 @@ function SuggestedProfileCard({
},
{threshold: 0.5},
)
// @ts-ignore - web only
// @ts-expect-error - web only
observer.observe(node)
return () => observer.disconnect()
} else {