Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

216
Vistas
How to save Switch toggle state in React Native?

I have Switch toggle Btn which has each Alert Modal when it toggle. Alert Modal works well but Switch mode keeps show on 'true', when I toggled it 'false' and Re-render app. How can I save last state of Switch Value? This is what I got.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here , if switch switch value is off the you have to set both toggleOff , ToggleOn ,take reference of below code :

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda