React Essay II

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.