小编Ken*_*Tan的帖子

如何使用react-redux-firebase从firestore获取子集合

我无法从 Firestore 数据中获取子集合。

我按照文档here。并且还看了很多其他类似的问题。

我似乎无法获得我想要获得的数据数组。

我的代码:

import "../../styles/projects/ProjectDashboard.css";
import ProjectList from "./ProjectList";
import { connect } from "react-redux";
import { firestoreConnect } from "react-redux-firebase";
import { compose } from "redux";
import { Redirect } from "react-router-dom";

export class ProjectDashboard extends Component {
  render() {
    const { projects, auth } = this.props;
    if (!auth.uid) return <Redirect to="/sigin" />;
    return (
      <div className="container">
        <h2>Projects</h2>
        <ProjectList projects={projects} />
      </div>
    );
  }
}

const mapStateToProps = state => {
  console.log(state);
  return { …
Run Code Online (Sandbox Code Playgroud)

firebase reactjs react-redux google-cloud-firestore react-redux-firebase

5
推荐指数
1
解决办法
2280
查看次数