Skip to content

Instantly share code, notes, and snippets.

@radzserg
Created July 10, 2019 08:43
Show Gist options
  • Select an option

  • Save radzserg/7fde566445e8f0344d1e23e017b70568 to your computer and use it in GitHub Desktop.

Select an option

Save radzserg/7fde566445e8f0344d1e23e017b70568 to your computer and use it in GitHub Desktop.
import * as React from "react";
import { PureComponent } from "react";
interface IProps {
label: string;
doSomeMagic: () => void;
}
export default class Foo extends PureComponent<IProps> {
render() {
return (
<div onClick={this.props.doSomeMagic}>
{this.props.label}
</div>
);
}
}
<Foo label="bar" doSomeMagic={() => alert("It's a magic")}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment