Failed prop type: The prop `actions` is marked as required in `Testing`, but its value is `undefined`

前端 未结 2 1850
暖寄归人
暖寄归人 2021-01-25 10:09

I am creating a simple login form using React and Redux. My app.js is:

import React from \'react\';
import { render } from \'react-dom\';
import Inp         


        
2条回答
  •  执笔经年
    2021-01-25 10:41

    I believe you need to connect your component to redux.

    import { connect } from 'react-redux'
    
     // your code
    
     export default connect(mapStateToProps, mapDispatchToProps)(Testing)
    

    Don't forget to remove export default from before your class as well.

    Edit: Please use setState if you're planning on modifying the local state of a component.

提交回复
热议问题