嗨,我正在尝试学习 firebase。现在我正在尝试关注 github 文档中的内容。
这是我的 index.js 文件
const rfConfig = {}; // optional redux-firestore Config Options
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: 'something',
authDomain: 'something',
databaseURL: 'something',
projectId: 'something',
storageBucket: 'something.com',
messagingSenderId: 'something',
appId: '1:something',
measurementId: 'G-something',
};
firebase.initializeApp(firebaseConfig);
// Initialize Cloud Firestore through Firebase
firebase.firestore();
// Add reduxFirestore store enhancer to store creator
const createStoreWithFirebase = compose(
reduxFirestore(firebase, rfConfig), // firebase instance as first argument, rfConfig as optional second
)(createStore);
// Add Firebase to reducers
const rootReducer = combineReducers({
firestore: firestoreReducer,
});
// Create store with reducers and initial state
const initialState = {};
const store = createStoreWithFirebase(rootReducer, initialState);
ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
<App />
</Provider>
</React.StrictMode>,
document.getElementById('root')
);
我的文件夹有 3 个组件。1 用于添加待办事项。1 用于显示待办事项。& 最后一个是前两个的组合
largeQ
相关分类