Skip to content

Instantly share code, notes, and snippets.

@eyaleizenberg
Last active June 12, 2019 05:22
Show Gist options
  • Save eyaleizenberg/4f286a960f513683b4f224c97db94561 to your computer and use it in GitHub Desktop.
Save eyaleizenberg/4f286a960f513683b4f224c97db94561 to your computer and use it in GitHub Desktop.
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