IjzerenHein / firestorter

Use Google Firestore in React with zero effort, using MobX 🤘
http://firestorter.com
MIT License
378 stars 50 forks source link

ReactNative hotreload error #102

Closed rborn closed 3 years ago

rborn commented 4 years ago

Hi, this module is amazing, thanks so much for building it 😻

I have an issue with hotreload in RN, that from time to time I get an error complaining initFirestorter was already called.

Is there a way to avoid this? (you need to basically restart the app)

Thanks 🤗

IjzerenHein commented 3 years ago

In order to address that I would recommend checking whether you have called initFirestorter already, and don't call it again if you already have

rborn commented 3 years ago

@IjzerenHein I managed by patching the module and convert the error in a warning. The hot reload from ReactNative reloads all the code, so initFirestorter gets called again and there is not much you can do.