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

87
Views
Versión Firebase v9 de firebase.apps.length

En una aplicación React, normalmente inicializo Firebase de esta manera:

 if (firebase.apps.length < 1) { firebase.initializeApp(firebaseConfig); // Initialize other firebase products here }

Esto funcionó perfectamente hasta que actualicé a v9 beta. ¿Cómo puedo hacer que funcione para la nueva versión?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

La forma correcta de hacerlo es usar getApps() :

 import { getApps, initializeApp } from "firebase/app"; if (getApps().length < 1) { initializeApp(firebaseConfig); // Initialize other firebase products here }
about 4 years ago · Juan Pablo Isaza Report

0

Una solución simple que me ha funcionado para v9 es esta:

 import { initializeApp } from "firebase/app"; let firebase; if (!firebase) { firebase = initializeApp(config) }
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!