Just loaded firebase 3.0 with react-native and getting the error
[fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Can't find variable: document
Is react-native supported yet?
React-native code:
var firebase = require('firebase') // Initialize Firebase var config = { apiKey: '<apiKey>', authDomain: '<app>.firebaseapp.com', databaseURL: 'https://<app>.firebaseio.com', storageBucket: 'firebase-<app>.appspot.com' }; firebase.config(config)
The newest version of firebase uses the document variables that are used in web applications and the RCTWebSocket or RCTView doesn't work the same way. (I'm not 100% sure about all the details). Anyway, you can just install an older version of firebase and it will work for you. Assuming you have npm installed follow these instructions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With