我想连接消防局,以便能够使用firebase,我的操作完全与指南中的操作类似(可能不是)。
我明白了:
TypeError: Object(...) is not a function
Module../src/components/SessionList/SessionList.js
C:/dev/play-react/src/components/SessionList/SessionList.js:68
65 | function mapDispatchToProps(dispatch) {
66 | return {...bindActionCreators(mainActions, dispatch)}
67 | };
> 68 | export default compose(
69 | connect(mapStateToProps,mapDispatchToProps),
70 | fireStoreConnect([
71 | { collection: 'sessionList'}
代码:
import React, { Component } from 'react';
import {connect} from "react-redux";
import {compose} from "redux";
import {fireStoreConnect} from "react-redux-firebase";
import {bindActionCreators} from "redux";
import axios from '../../axios-sessions';
....
export default compose(
connect(mapStateToProps,mapDispatchToProps),
fireStoreConnect([
{ collection: 'sessionList'}
])
)(SessionList, axios);