Skip to content

Instantly share code, notes, and snippets.

@mohammadkarbalaee
Created July 11, 2022 05:10
Show Gist options
  • Save mohammadkarbalaee/330e72ee504d377f6e4b95cbb64ee2b3 to your computer and use it in GitHub Desktop.
Save mohammadkarbalaee/330e72ee504d377f6e4b95cbb64ee2b3 to your computer and use it in GitHub Desktop.
/*
this is how you pass arguments when assigning a callback in React
*/
const callback = (event,argument) => {
console.log(argument) //will print yess
}
<div onClick={this.callback.bind(this,"yes")}>
hello world!
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment