1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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