From d7ab72a10ce259072db50b829ef323fa115226c3 Mon Sep 17 00:00:00 2001 From: Benjamin Atkin Date: Thu, 7 Dec 2017 13:35:08 -0800 Subject: [PATCH] add initialization of state to States --- react.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/react.md b/react.md index 994918b15..7eb538ff6 100644 --- a/react.md +++ b/react.md @@ -69,6 +69,13 @@ See: [Properties](https://reactjs.org/docs/tutorial.html#using-props) ### States +```jsx +constructor(props) { + super(props) + this.state = {} +} +``` + ```jsx this.setState({ username: 'rstacruz' }) ```