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

82
Vistas
Loading spinner not showing

I am using firebase in a react native app along with the spinner from 'react-native-loading-spinner-overlay'. Im trying to show the spinner while the user is authenticating to firebase but the spinner isn't showing up. This is the function that handles an user trying to auth:

const [spinnerState, setSpinnerState] = useState(false)
...
const handleAuthenticationAttempt = () => {
            if (emailStatus == false || passwordStatus == false) {
                  Alert.alert(
                        "ERROR",
                        "Something went wrong... Please make sure you have inserted all data correctly.",
                        [{
                              text: "OK",
                              style: "ok",
                        }])
            } else {
                  const auth = getAuth(app);
                  setSpinnerState(true)
                  signInWithEmailAndPassword(auth, email, password)
                        .then(() => {
                              setSpinnerState(false)
                              console.log("success")
                        })
                        .catch((error) => {
                              Alert.alert(
                                    "ERROR",
                                    "Something went wrong... Please check the email and password you entered is correct: " + error.code,
                                    [{
                                          text: "OK",
                                          style: "ok",
                                    }])
                        })
            }
      }

This is my render:

<View style={styles.container}>
                  <Spinner
                        visible={spinnerState}
                        textContent={'Loading...'}
                        textStyle={{ color: 'rgb(200, 200, 200)' }} />
                  <View style={styles.containerSvg}>
                        <LinearBackground />
                  </View>
                  <TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
                        <View style={styles.containerAlign}>
                              // OTHER INPUTS
                              <ButtonAction onPress={handleAuthenticationAttempt} text={'LOGIN'} backgroundColor='rgba(20, 120, 160, 0.6)' />
                        </View>
                  </TouchableWithoutFeedback>
            </View>

In theory this should work but it doesn't. I have changed the spinner location multiple times but it never seems to show up. Any ideas on what's going on?

EDIT: Even when using setTimeout, the spinner never actually shows up.

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

0

Fixed it, had to use conditional rendering, which is quite strange considering other snack examples using what I had above worked.

{loadingStatus && <Spinner
                        visible={true}
                        textContent={'Loading...'}
                        textStyle={{
                              color: '#FFF'
                        }} />
                  }
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