This week do Demo3 and Demo4, 5 with notes of the small point.
1, JS error hint: Warning:each child in an array or iterator should has a unique "key" prop. Check the Render method of ' HelloMessage '. See Https://fb.me/react-warning-keys for more information.
Workaround, add a key property to the component and assign a unique key value to identify it. 2, the state value changes--this.state.isvisible or This.setstate ({isvisible:true}) two ways, this.setstate ()----in time to refresh the DOM, This.state ()----Use alone cannot refresh the DOM in time, you need to use ForceUpdate () 3, props implement the parent component to pass data to the subcomponent getdefaultprops: Set the default property, return an object 4, event. Use value directly to assign a value to input without onchange the event to listen. The resulting input is only the value set in your code. The user cannot directly change the value of input. Can be set with DefaultValue instead of value. Or add a onchange event.
React Essay II