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

107
Views
Cambiar la propiedad de estilo de visualización entre "ninguno" y "flex" con Animated from React-Native

¿Cómo puedo cambiar entre mostrar ninguno y flex usando valores animados? Intenté interpolar a 0 y 1 y, según el valor, cambie la propiedad de visualización.

Estoy tratando de ocultar Animated.View cuando el valor animado llega a 90 pero no pasa nada.

 // change animated value from 0 to 180 const flip = () => { Animated.timing(flipAnimation, { toValue: 180, duration: 300, useNativeDriver: true, }).start(); }; //if the animated value is between 0 and 90 it will return 0 else it will return 1 const interpolate = flipAnimation.interpolate({ inputRange: [0, 90, 91, 180], outputRange: [0, 0, 1, 1], }) //if the value is 1 set display to "none" else set it to "flex" <Animated.view style={{ display: interpolate === 1 ? "none" : "flex" }}/>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto es lo que terminó funcionando para mis necesidades, dejé de intentar que funcionara con Animated y simplemente usé reanimated:

 const hideFrontStyle = useAnimatedStyle(() => { return { display: flipAnimation.value >= 90 ? "flex" : "none", }; });
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!