React notes (update)

Source: Internet
Author: User

React:

1,react.render is the most basic method of React for converting a template to an HTML language and inserting a specified DOM node

The 2,react.createclass method is used to generate a component class

The properties of the 3,this.props object correspond to the properties of the component one by one This.props.children property represents all child nodes of the component

4,react.finddomnode the node that gets the real DOM from the component

5,this.state Methods for reading components This.setstate setting up components

6,this.props represents features that are not changed once defined, whereas This.state is a feature that changes as users interact

7,event.target.value read user-entered values

8,style={{display: ' None '}}

9,props data passed from a parent node to a child node

10,getinitialstate () Sets the initialization state of a component only once during the lifetime of the component

11,componentdidmount is a method that react automatically calls when a component is rendered

12, use the ref attribute to name the subassembly, this.refs reference the component. Call Getdomnode () on the component to get the local DOM element of the browser

13,row (transverse scaling) and column (longitudinal scaling)

The 14,react width is based on PT and can be dimensions to obtain a wide height, pixelratio get the density

The view default width is 100%

Horizontal Center with Alignitems, vertical center with justifycontent

Flex-based enables existing grid system requirements, and grids can be nested without bugs

16, through the Image.resizemode to fit the picture layout, including contain, cover, stretch

Default mode is not set equal to cover mode

Contain mode adaptive wide-height, give the altitude value can be

Cover are covered with containers, but they do intercept.

Stretch covered with container, stretched

17, Position relative to parent element, parent element not set position also line

Padding there is a bug when setting on the text element. All padding become marginbottom.

18, the text must be placed inside the text element

Text elements can be nested with each other, and there is a style inheritance relationship

The numberoflines needs to be placed on the outermost text element, and while the text is truncated, it takes up space

React notes (update)

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.