Last active
June 12, 2019 05:22
-
-
Save eyaleizenberg/4f286a960f513683b4f224c97db94561 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 { reportUserLogin } from '../services/data-service'; | |
interface Props { | |
name: string; | |
} | |
export class HelloPerson extends React.PureComponent<Props> { | |
componentDidMount() { | |
const { name } = this.props; | |
if (name === 'Eyal') { | |
reportUserLogin(name); | |
} | |
} | |
render() { | |
return ( | |
<div> | |
<h1>Welcome!</h1> | |
<span id="name">{this.props.name}</span> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment