React Native Firebase fills the console with 'This method is deprecated' warnings
Your error
This method is deprecated (as well as all React Native Firebase namespaced API) and will be removed in the next major release as part of move to match Firebase Web modular SDK API. Please see migration guide for more details: https://rnfirebase.io/migrating-to-v221 more line it can showFix it fast
Most common cause, 1 of 3Your code uses the namespaced call style
Import the modular functions and pass the service object to them.
// before
// import auth from '@react-native-firebase/auth'
// await auth().signInWithEmailAndPassword(email, password)
// after
import { getAuth, signInWithEmailAndPassword, onAuthStateChanged } from '@react-native-firebase/auth'
import { getFirestore, collection, query, where, getDocs } from '@react-native-firebase/firestore'
const auth = getAuth()
await signInWithEmailAndPassword(auth, email, password)
onAuthStateChanged(auth, user => console.log(user?.uid))
const db = getFirestore()
const snap = await getDocs(query(collection(db, 'cities'), where('capital', '==', true)))Short answer
Since v22, React Native Firebase logs a warning for every call made through the old namespaced style, such as auth().signInWithEmailAndPassword() or firestore().collection(), because that API is being removed in favour of the modular functions the Firebase web SDK uses. Rewrite each call as getAuth(), getFirestore() plus the matching function. A global flag can hide the warnings while you migrate.
Which cause do you have?
List the namespaced calls in your code. Each line that calls a module as a function, like auth() or firestore(), is one item to migrate.
grep -rnE "(auth|firestore|messaging|storage|database|analytics|crashlytics|functions|remoteConfig)\(\)\." src app 2>/dev/null
grep -rn "firebase.app()" src app 2>/dev/nullThen find the line you see in this list and open its fix:
- 1Your code uses the namespaced call style
The warning points at code like auth().signInWithEmailAndPassword(email, pw) or firestore().collection('cities') - 2You cannot tell which call triggers each warning
Dozens of identical warnings appear and none shows a useful line number - 3You need a quiet console while the migration is in progress
The warnings hide real errors during development
What does the error look like?
This method is deprecated (as well as all React Native Firebase namespaced API) and will be removed in the next major release as part of move to match Firebase Web modular SDK API. Please see migration guide for more details: https://rnfirebase.io/migrating-to-v22Error: Deprecated API usage detected while in strict mode.
Cause 1 of 3
Your code uses the namespaced call style
You seeThe warning points at code like auth().signInWithEmailAndPassword(email, pw) or firestore().collection('cities')
Check
The v22 migration guide says the namespaced API is being removed and that the modular API matches the Firebase JS SDK, so the Firebase web documentation's modular snippets apply. The pattern is the same for every call: get the service instance, then pass it to an imported function.
grep -rn "from '@react-native-firebase/" src app | grep -v "{"Fix
Import the modular functions and pass the service object to them.
// before
// import auth from '@react-native-firebase/auth'
// await auth().signInWithEmailAndPassword(email, password)
// after
import { getAuth, signInWithEmailAndPassword, onAuthStateChanged } from '@react-native-firebase/auth'
import { getFirestore, collection, query, where, getDocs } from '@react-native-firebase/firestore'
const auth = getAuth()
await signInWithEmailAndPassword(auth, email, password)
onAuthStateChanged(auth, user => console.log(user?.uid))
const db = getFirestore()
const snap = await getDocs(query(collection(db, 'cities'), where('capital', '==', true)))Verify
Exercise the screen again; that call no longer logs the deprecation warning.
npx react-native start # watch the Metro log while you use the screenConfirmed by rnfirebase.io
Cause 2 of 3
You cannot tell which call triggers each warning
You seeDozens of identical warnings appear and none shows a useful line number
Check
The guide describes a strict mode that throws instead of warning. In the package source, the warning path raises 'Deprecated API usage detected while in strict mode.' when the flag is on, and the stack trace then points at the calling line.
grep -rn "RNFB_MODULAR_DEPRECATION_STRICT_MODE" index.js App.tsx 2>/dev/nullFix
Turn on strict mode in development only, fix the line each crash points to, then turn it off.
// index.js, before any Firebase import is used
if (__DEV__) {
globalThis.RNFB_MODULAR_DEPRECATION_STRICT_MODE = true
}Verify
With strict mode on, the app runs through every screen without throwing.
npx react-native run-androidConfirmed by rnfirebase.io
Cause 3 of 3
You need a quiet console while the migration is in progress
You seeThe warnings hide real errors during development
Check
The same guide documents a global flag that switches the warning logs off. It must be set before Firebase is initialized; it hides the messages but changes nothing about the deprecation itself.
grep -rn "RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS" . --include=*.js --include=*.ts --include=*.tsx | grep -v node_modulesFix
Set the flag at the very top of the entry file and keep a ticket to remove it once the code is modular.
// index.js (first lines)
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = trueVerify
Reload the app; the deprecation lines are gone from the log.
npx react-native start --reset-cacheConfirmed by rnfirebase.io
How do I stop it coming back?
- Write all new Firebase code in the modular style, copying from the web SDK's modular snippets.
- Migrate one Firebase service at a time and keep the app releasable after each one.
- Read the migration guide for every React Native Firebase major you install; removals arrive service by service.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.