为什么在编写fireStoreConnect时会出现“ Object(...)不是函数”的原因

时间:2018-12-31 19:54:07

标签: reactjs firebase redux

我想连接消防局,以便能够使用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);

0 个答案:

没有答案