Created
January 4, 2019 02:41
-
-
Save CodingItWrong/6a2dd3c16f5bf3511cc6ad4574f395ac to your computer and use it in GitHub Desktop.
This file contains 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
export default class App extends Component { | |
+ state = { messages: [] } | |
+ | |
handleSend = (newMessage) => { | |
+ this.setState(state => ({ messages: [newMessage, ...state.messages] })); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment