dvajs / dva

🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
https://dvajs.com/
MIT License
16.24k stars 3.17k forks source link

React.memo 和connect的包裹问题 #2421

Closed zhaozedong closed 3 years ago

zhaozedong commented 3 years ago

function mapStateToProps ({ common }:{ common:CommonModelState }) { return { common } }

function compare (prevProps: Readonly<PropsWithChildren>, nextProps:Readonly<PropsWithChildren>) { return prevProps.common.shopBasic.uid_status == nextProps.common.shopBasic.uid_status }

export default withRouter(connect(mapStateToProps)( memo(NewPeopleModal,compare)))

报错 Uncaught Invariant Violation: You must pass a component to the function returned by connect. Instead received {}

react17 antd-mobile2.3.4

sin1ght commented 3 years ago

同样的问题,版本是2.4.1 "react-redux": "5.0.7",react-redux版本被写死了,5.1修复了

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.