Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active September 19, 2021 20:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/e7108c9dc2d25e2a3d651b427965f425 to your computer and use it in GitHub Desktop.
Save dance2die/e7108c9dc2d25e2a3d651b427965f425 to your computer and use it in GitHub Desktop.
class Greeting extends Component {
hello = id => console.log(`hello world! - ${id}`);
componentDidMount() {
const id = shortid.generate();
setInterval(e => this.hello(id), 1000);
}
componentWillUnmount() {
console.log("Greeting unmounted...");
}
render() {
return (
<div>
<Link to="/main">Go to Main Page</Link>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment