Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created October 6, 2014 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/5a287fb97d983d358568 to your computer and use it in GitHub Desktop.
Save tmcw/5a287fb97d983d358568 to your computer and use it in GitHub Desktop.
<a href='#' className='icon inline pad0y trash quiet' data-field={field} onClick={this.props.destroyFilter}></a>
<a href='#' className='icon inline pad0y trash quiet' onClick={this.props.destroyFilter.bind(this, field)}></a>

In the second example, destroyFilter will be called with field as its first argument. See Function.bind for full deets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment