.map不显示列表(来自API)

提前谢谢!! 我有麻烦了,我不知道我的地图出什么问题了。我是新来的学生(JS,React,Redux)。它应该显示一个列表(或至少一个名字,任何东西),但是什么也没发生。

 import React,{Component} from "react";
    import { connect } from "react-redux";
    import { push } from "connected-react-router";
    import { getTrips } from "../../actions/allactions";
    import List from "@material-ui/core/List";

    class ListTrips extends Component {
        componentDidmount() {
          this.props.getTripsaction();
        }

        render() {
          return (
              <List>
                  {
                      this.props.trips.map((trip) => {
                          return(<li>{trip.name}</li>)
                      })
                  }
              </List>
          );
      }
    }

      const mapstatetoProps = state => ({
        trips: state.trips.trips
      });

      const mapDispatchToProps = dispatch => ({
        getTripsaction: () => dispatch(getTrips()),});

      export default connect(
        mapstatetoProps,mapDispatchToProps
      )(ListTrips)
xaut2008 回答:.map不显示列表(来自API)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3155889.html

大家都在问