Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda