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í.
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}) }}