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