问题描述:

I ve to redirect to another page when ever the user checks the checkbox.

I am new to react-redux. Right now,all I know is to handle submit

button through dispatchaction but I am wondering how to handle

checkbox action?

 export default class myReportForm extends BaseForm {

return(

</form>

</div>

);

}

}

Through handleSubmit in form, I could able to handle submit action. Can any one tell me how to handle checkbox . For example, when I ever click on Afloat , It should redirect me to another page or atleast some action should happen.

网友答案:

mapStateToProps and mapDispatchToActions are helper functions that will wire up the your component to the redux store. mapStateToProps links your component's properties to the state and mapDispatchToActions links its events to actions that can be dispatched.

http://redux.js.org/docs/basics/UsageWithReact.html#container-components

As ever (I'm always recommending this!) have a look at:

https://egghead.io/lessons/javascript-redux-generating-containers-with-connect-from-react-redux-visibletodolist (the whole course and its follow-up - Idiomtic Redux - are great).

相关阅读:
Top