Skip to content

Instantly share code, notes, and snippets.

@esshka
Created June 27, 2018 14:48
Show Gist options
  • Save esshka/ec8e475da9a469edf1127d5584a1db1f to your computer and use it in GitHub Desktop.
Save esshka/ec8e475da9a469edf1127d5584a1db1f to your computer and use it in GitHub Desktop.
onClick.js
private onClick(event: React.SyntheticEvent<EventTarget>) {
const { onCellClick } = this.props;
const target = event.target as HTMLElement;
const rowIndex = Number(target.getAttribute('data-row'));
const colIndex = Number(target.getAttribute('data-column'));
onCellClick({
rowIndex,
colIndex
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment