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

80
Views
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 answers
Answer question

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 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!