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

231
Views
¿Por qué el uso de Animated.createAnimatedComponent(Pressable) rompe mi funcionalidad Pressable?

Estoy tratando de animar un componente Pressable, por eso estoy tratando de hacerlo animable de esta manera:

 const AnimatedPressable = Animated.createAnimatedComponent(Pressable);

Y luego úsalo en lugar de esto:

 <Pressable style={({ pressed }) => [ styles.button, styles[variant], { width, elevation: pressed && variant !== 'tertiary' ? 5 : 0 }, { ...(variant === 'tertiary' && pressed ? { backgroundColor: colors.primary50 } : {}) }, style, ]} {...rest} > <HeaderText variant="h4" style={[styles.text, { color: textColor }]}> {title} </HeaderText> </Pressable>

El problema es que tan pronto como reemplazo Pressable con AnimatedPressable, mis estilos se rompen. Después de juguetear un poco, me di cuenta de que se rompen por esto:

 style={({ pressed }) => [ styles.button, styles[variant], { width, elevation: pressed && variant !== 'tertiary' ? 5 : 0 }, { ...(variant === 'tertiary' && pressed ? { backgroundColor: colors.primary50 } : {}) }, style, ]}

Si quito el presionado, funciona bien:

 style={[ styles.button, styles[variant], style, ]}

¿Por qué no puedo usar prensado en ese caso?

about 4 years ago · Juan Pablo Isaza
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!