Skip to content
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

Question 15 Enhancement. #18

Closed
umair-khanzada opened this issue Jun 11, 2019 · 1 comment
Closed

Question 15 Enhancement. #18

umair-khanzada opened this issue Jun 11, 2019 · 1 comment

Comments

@umair-khanzada
Copy link

umair-khanzada commented Jun 11, 2019

How to pass a parameter to an event handler or callback?

There is another way I think you need to add this as well, It is quite simple and easy to understand.

methodName = (parameter) => () => {
  //Do something with parameter.
  console.log("parameter", parameter)
};

<button onClick={this.methodName('value you want to pass')} >Click</button>
@sudheerj
Copy link
Owner

Thanks @umair-khanzada. I updated the question with this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants