Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

195
Views
Typescript React Native AnimatedEvent: 'Tipo 'número' no es asignable para escribir 'Mapeo'.ts (2322)'

Obtener este problema de mecanografiado 'Escribir 'número' no se puede asignar al tipo 'Mapeo'.ts (2322)' Esto ocurre cuando se intenta agregar un evento animado en el desplazamiento... el conocimiento de mecanografiado es un poco escaso y me pregunto si alguien podría indicarme ¿la dirección correcta? por favor :)

Captura de pantalla del problema1

Aquí está el código que he renderizado una FlatList

 const Carousel: FunctionComponent<CarouselProps> = ({ data }) => { if (data && data.length) { return ( <View> {data && data.length && ( <FlatList data={data} keyExtractor={(item, index) => 'key' + index} horizontal pagingEnabled scrollEnabled scrollEventThrottle={16} snapToAlignment='center' decelerationRate={'fast'} showsHorizontalScrollIndicator={false} renderItem={({ item }) => { return <CarouselItem item={item} />; }} onScroll={Animated.event([{nativeElement: { contentOffset: { x: screenX }}}])} /> )} <View style={styles.dotView}> {data.map((_: any, i: any) => { let opacity = position.interpolate({ inputRange: [i - 1, i, i + 1], outputRange: [0.3], extrapolate: 'clamp' }); return ( <Animated.View key={i} style={{ opacity, height: 10, width: 10, margin: 8, borderRadius: 5 }} /> ); })} </View> </View> ); } else { return null; } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debe definir qué es scrollX. Por ejemplo, crea una const como esta:

 const scrollX = React.useRef(new Animted.Value(0)).current;

¡Y eso debería funcionar bien!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!