Skip to content

Instantly share code, notes, and snippets.

@sajithdilshan
Last active November 19, 2017 12:39
Show Gist options
  • Save sajithdilshan/b38201fc1a19cac76d3feaa78e78b704 to your computer and use it in GitHub Desktop.
Save sajithdilshan/b38201fc1a19cac76d3feaa78e78b704 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import Alice from './Alice';
class App extends Component {
constructor() {
super();
this.state = {
greeting: "Hello World!",
parentMessage: "Hello Alice!"
}
setTimeout(() => {
this.setState({greeting : "Hello World Updated!"})
}, 10000)
}
render() {
return (
<div className="greeting">
<h1> {this.state.greeting} </h1>
<Alice newMsg={this.state.parentMessage} />
</div>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment