Created
July 10, 2019 08:43
-
-
Save radzserg/7fde566445e8f0344d1e23e017b70568 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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