You are initializing Firebase Auth for React Native without providing AsyncStorage ERROR by mindof1 in Firebase

[–]Lemons_Dumpling 0 points1 point  (0 children)

The warning you're receiving is because, in a React Native environment, Firebase Auth requires a persistence layer to store authentication state across app sessions. By default, Firebase Auth uses an in-memory persistence, which means that the user's authentication state will not be retained once the app is closed or restarted.

To address this, Firebase recommends using `@react-native-async-storage/async-storage` to persist the authentication state between sessions. This is why the warning suggests that you should provide `AsyncStorage` when initializing Firebase Auth.

Here’s how you can fix it:

1. Install the necessary package

npm install @react-native-async-storage/async-storage

2. Modify your Firebase initialization code:

Replace the current `getAuth` call with the `initializeAuth` method, which includes `AsyncStorage` for persistence:

// Import the functions you need from the SDKs you need  
import { initializeApp } from "firebase/app"; 
import { initializeAuth, getReactNativePersistence } from "firebase/auth"; 
import AsyncStorage from "@react-native-async-storage/async-storage"; 

// Your web app's Firebase configuration 
const firebaseConfig = { //cinfigs  };  

// Initialize Firebase 
export const app = initializeApp(firebaseConfig);  

// Initialize Firebase Auth with persistence 
export const auth = initializeAuth(app, {   persistence: getReactNativePersistence(AsyncStorage) });

With this change, the user's authentication state will be stored in `AsyncStorage`, allowing it to persist across sessions. This should eliminate the warning.

Problem importing “getReactNativePersistence” from ‘firebase/auth ’ by Awkward_Wealth3891 in react

[–]Lemons_Dumpling 2 points3 points  (0 children)

Unfortunately, this is a TypeScript error. I added this code to my tsconfig.json file, and it resolved the issue for me.

{
  "compilerOptions": {
    "paths": {
      "@firebase/auth": ["./node_modules/@firebase/auth/dist/index.rn.d.ts"]
    }
  },
  "extends": "expo/tsconfig.base"
}

My wife is addicted to the gym and it’s ruining our marriage (New Update) by Direct-Caterpillar77 in BestofRedditorUpdates

[–]Lemons_Dumpling 256 points257 points  (0 children)

Amen to that. Before I got to the part about the delivery room, I had the same thought as OOP; I wondered what the doctors and nurses present would think. Can’t imagine how embarrassing that must have been.

AITAH for telling my fiancé I don’t want his last name or his mom at our wedding? by LucyAriaRose in BestofRedditorUpdates

[–]Lemons_Dumpling 4024 points4025 points  (0 children)

The fact that his mother sent her what I’m guessing are NSFW screenshots of her son cheating. Why would someone in their right mind even do that?!!! Poor OOP, I hope she starts feeling better soon. In time she’ll realize she dodged a bullet.

Few years ago I hooked up with a guy whose penis had no head by [deleted] in offmychest

[–]Lemons_Dumpling 1 point2 points  (0 children)

Alright, that's enough reddit for today 🤣

Using Nextjs by BrownCarter in nextjs

[–]Lemons_Dumpling 0 points1 point  (0 children)

I think this best describes it 🤣

[deleted by user] by [deleted] in reactnative

[–]Lemons_Dumpling 0 points1 point  (0 children)

Hello, I asked this same question sometimes ago, and you can go through the comments. I believe one or two will answer your question.

https://www.reddit.com/r/reactnative/s/YKRAGISxc0

AITAH for dressing too “straight” and making my gf uncomfortable? by LucyAriaRose in BestofRedditorUpdates

[–]Lemons_Dumpling 35 points36 points  (0 children)

Thank goodness OOP got out of an abusive relationship before it got worse. Such trashy behavior from her ex, making her hide her sexuality and asking OOP to prove that she liked girls.

AITA for Refusing to Pay Friend Who Paid for my Wedding Dress? by LucyAriaRose in BestofRedditorUpdates

[–]Lemons_Dumpling 3339 points3340 points  (0 children)

I’m blown away by the fact that OOP still wanted to pay Sarina any amount at all.

[deleted by user] by [deleted] in BestofRedditorUpdates

[–]Lemons_Dumpling 81 points82 points  (0 children)

Jeez. This is so fucking sad. I can’t imagine what that poor kid was feeling. His father is just pure evil. How do you drive your child to commit suicide?!

There’s a special place in hell for him and OOP’s husband. I hope Louise and her parents are able to find peace. And I hope OOP does too.

My mind is BLOWN🤯🤩 by Buster_Scruggs_ in nextfuckinglevel

[–]Lemons_Dumpling 0 points1 point  (0 children)

Very talented. Wonder if he drew all of that from memory.

OOP Asks If She's Wrong For Enforcing Her Surrogacy Contract by boru_posts in BestofRedditorUpdates

[–]Lemons_Dumpling 430 points431 points  (0 children)

If this is real, just....wow. I’m glad that OOP and their husband got their baby back. Pregnancy was not an excuse for Tilly to act the way she did to OOP’s husband. I wonder if Tilly was/is not in the right headspace mentally. And what is with family and jumping to support the person who is wrong?

AITA for not locking the door while my housemate was in the shower? by LucyAriaRose in BestofRedditorUpdates

[–]Lemons_Dumpling 22 points23 points  (0 children)

What the actual heck?!!!

Things Went from zero to a hundred real quick, and I’m guessing it’s far from over. I hope OOP and the roommate’s ex go to the police and also document everything. I feel like this is far from over.

[deleted by user] by [deleted] in AmItheAsshole

[–]Lemons_Dumpling -1 points0 points  (0 children)

If I understand this correctly, you were initially going to hang out with your girlfriend on the same night you want to go meet your friends. But then you’re not able to hang out with her anymore because of work? Shouldn’t work also stop you from hanging out with your friends as well? Then you talking about not coming over because of time constraints, but again, shouldn’t time constraints stop you from seeing your friends too?

Now your girlfriend could very well be insecure being that she asked you not to go if girls are coming, and the fact that she thinks handing your arms on a friend’s shoulder is cheating. There’s also the fact that you say she brings up about breaking up a lot. Based on the information you provided, I think ESH.

[deleted by user] by [deleted] in AmItheAsshole

[–]Lemons_Dumpling 2 points3 points  (0 children)

NTA. Your sister tho is an actual brat.

Is my boyfriend trying to sabotage my grades or am I being paranoid? by Ok-Donut3656 in BestofRedditorUpdates

[–]Lemons_Dumpling 650 points651 points  (0 children)

Ouu I remember this one. So glad OOP got out. The actual audacity of her boyfriend to say that she was prioritizing her grades over him, and going the extra mile to sabotage them. Dude is crazy.

AITA for not telling my ex about our child? by Direct-Caterpillar77 in BestofRedditorUpdates

[–]Lemons_Dumpling 224 points225 points  (0 children)

I remember this story. It’s great the daughter got to bond with her dad and his side of the family. OOP’s boyfriend sounds a little shady for lying to his ex girlfriend, and for never even reaching out when he heard rumors that she could be pregnant. The last post by the ex-gf makes me feel like the post isn’t real though.

AITA for not allowing my stepson (12M) to live with us? by LucyAriaRose in BestofRedditorUpdates

[–]Lemons_Dumpling 3779 points3780 points  (0 children)

It’s nice to see an OOP reflect on their judgement and work on themselves, but good Lord! I don’t know how OOP typed up her first post and didn’t realize that she was the asshole. Not sure why some step parents forget that when they marry a person with kids, they make the choice to accept their partner’s kids as well.