class Home extends React.Component { constructor(props, context) { super(props, context) this.shouldComponentUpdate = PubeRederMixin.shouldComponentUpdate.bind(this) } render() { return ( <div> <HomeHeader cityName = {this.props.userinfo.cityName}/> <Category/> <div style = {{height: '15px'}}></div> <Ad/> <List cityName = {this.props.userinfo.cityName}/> </div> ) } } function mapStateToProps(state) { return { userinfo: state.userinfo } }
这个 userinfo 哪里来的, 我在此页面修改 userinfo 都多导致无法正确获取 cityName