-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An action is not dispatching #1393
Comments
In button onClick event is not properly bind to function. OR this line: |
Hi ananddodia, thanks very much for your help. I initially typed this: const {counter, incrementportfolio} = this.props; but it gives me this error: 16:21 error "incrementportfolio" is already declared in the upper scope no-shadow it is weird, does it ? because of that I decided to write this line in that way but I'll test your other option. Thanks a lot, I'll give you the result of the test. |
It works like a charm !! ... button className="btn btn-default" onClick={this.props.incrementportfolio}> it works !! but the question is why I get this error ? 16:21 error "incrementportfolio" is already declared in the upper scope no-shadow Why I can't to get incrementportfolio in this way ? const {counter, incrementportfolio} = this.props; Can you answer this question ? Thanks in advance |
Because you have So by doing |
@ycruzb sorry for late reply I am stuck in other work(Using this repo. I am trying to implement code split based on modules so only necessary js css are loaded and not one single js css.) helping hands are appreciated. change to this: |
Hi all !!! I've created a new redux module called portfolio.js, here is the content of the module:
then I have included it properly in reducer.js inside redux/modules and then I have created a component called PorfolioList.js with this code:
I have included this component properly in components/index.js and here comes the issue, the component is rendered well in the page and the button shows the initial value but the onclick doesn't fires the action. In redux dev tools I dispatch manually the action and the state is modified correctly. Why the onclick of the button is not firing the action ? Can you help me please ??
The text was updated successfully, but these errors were encountered: