[React Native Error]undefined is not an object (evaluating 'reducerX.yyy')

使用Redux报错

undefined is not an object (evaluating 'reducerX.yyy')
Unhandled JS Exception: undefined is not an object (evaluating 'reducerX.yyy')
[React Native Error]undefined is not an object (evaluating 'reducerX.yyy')_第1张图片
Redux_Error.png

解决:在对应的组件加上

function mapStateToProps(state) {
  const { reducerX } = state;
  return {
    reducerX
  }
}

export default connect(mapStateToProps)(组件名)

你可能感兴趣的:([React Native Error]undefined is not an object (evaluating 'reducerX.yyy'))