反应新手在这里!我有一个对象cats,其中包含猫位置的长绳列表。我试图将对象向下传递到MapContainer组件中,如下所示:
<MapContainer cats={cats} /></div>
MapContainer组件:
export class MapContainer extends Component {
constructor(props) {
super(props);
this.state = {
cats: // this should come from the parent component
}