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

403
Views
Obtenga el valor actual de Animated.Value, React-native

Estoy tratando de animar Ver con interpolación. Me gustaría obtener un valor actual de mi Animated.Value, pero no sé cómo. No entendí cómo hacerlo con documentos nativos de React .

 this.state = { translateAnim: new Animated.Value(0) } DeviceEventEmitter.addListener('Accelerometer', function (data) { console.log(this.state.translateAnim); // returns an object, but I need a value in current moment }
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Descubro, cómo obtener un valor:

 this.state.translateAnim.addListener(({value}) => this._value = value);

EDITAR

para registrar un valor hago lo siguiente:

 console.log(this.state.translateAnim._value)
over 4 years ago · Santiago Trujillo Report

0

Para las personas con mecanografiado.

 console.log((this.state.translateAnim as any)._value);

Funcionó para mí al tsc completo como cualquiera.

over 4 years ago · Santiago Trujillo Report

0

Esto también me funciona...

 const headerHeight = new Animated.Value(0);

Después de alguna manipulación....

 console.log(headerHeight.__getValue())

Se siente hackish pero hace el trabajo...

over 4 years ago · Santiago Trujillo 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!