0

I am trying to implement one functionality in React Boilerplate

1: https://github.com/react-boilerplate/react-boilerplate I have downloaded the code and run this command:

npm run setup

And it generated default homepage and feature page and then I run this command:

npm run generate

And generated the main container and added a link to the header component. I am trying to dispatch one-click action but it is not working. Have a look at the code I am using: Link to Action and Reducer

I have added this code in index.js:

<button onSubmit={onChangeUsername}>Click me</button>

and dispatching it using:

function mapDispatchToProps(dispatch) {
  return {
    onChangeUsername: evt => dispatch(changeUsername(evt.target.value)),
  };

I don't know why it is not working do I need to add this into the global reducer. This react boilerplate is good but I am unable to solve this puzzle.

Nilay Singh
  • 2,201
  • 6
  • 31
  • 61

0 Answers0