Warning: It looks like you're using the development build of the Firebase JS SDK

前端 未结 3 1972
无人及你
无人及你 2020-11-30 04:53

I\'ve integrated Firebase into my React.js app as such: https://firebase.google.com/docs/database/web/start

fire.js:
import firebase from \'firebase\'

var          


        
3条回答
  •  半阙折子戏
    2020-11-30 05:08

    The proper way to import firebase and getting rid of the warnings is:

    Always import this way

    import firebase from 'firebase/app';
    

    Then import each sub-modules (each firebase service) as needed

    import 'firebase/auth';        // for authentication
    import 'firebase/storage';     // for storage
    import 'firebase/database';    // for realtime database
    import 'firebase/firestore';   // for cloud firestore
    import 'firebase/messaging';   // for cloud messaging
    import 'firebase/functions';   // for cloud functions
    

提交回复
热议问题