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

220
Views
¿Cómo guardar el estado de alternancia de Switch en React Native?

Tengo Switch toggle Btn que tiene cada Alert Modal cuando alterna. Alert Modal funciona bien, pero el modo Cambiar sigue mostrándose en 'verdadero', cuando cambié a 'falso' y volví a renderizar la aplicación. ¿Cómo puedo guardar el último estado de Switch Value? Esto es lo que conseguí.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Aquí, si el valor del interruptor está desactivado, debe configurar tanto ToggleOff como ToggleOn, tome como referencia el siguiente código:

 toggleSwitch(){ this.setState({switchValue : !this.state.switchValue}) if(this.state.switchValue){ this.setState({toggleOff: true , toggleOn : false}) } else if(!this.state.switchValue){ this.setState({toggleOn : true , toggleOff : false}) }

}

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!