React version 0.12.2 Modify content

Source: Internet
Author: User



React new Version (0.12.2) released on December 18, 2014, compared to the v0.11.2 version I used before the change is very large, the basic writing is extended, so I immediately feel that I have to start again. The pit.



Things have to be re-adapted, first of all let's look at the basic wording of the REACT definition component:



v0.11.2 version of the wording:


 
var Klm = React.createClass({
    render:function(){ return( <h1>hello!</h1>  )
    }
});
React.renderComponent(<Klm />,document.body);





v0.12.2 version of the wording:


 
var Klm = React.createClass({
    render:function(){ return( <h1>hello!</h1>  )
    }
});
React.render(<Klm />,document.body);


Here rendercomponent is simplified to render, this is one!


 
var foo = {
    width:‘100px‘,
    height:‘100px‘,
    border:‘1px solid #000‘ }; var myDivElement = <div style={foo} />;
React.render(myDivElement, document.body);


Second: Defining a label individually can be used in this way.






React version 0.12.2 Modify content


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.