Reacto Small Project

Source: Internet
Author: User

This chapter describes the production of a review column.

First, simply write a ract component to try it out.

Index.html

<!DOCTYPE HTML><HTML><Head>    <title>Hello React</title>    <Scriptsrc=".. /js/jquery.min.js "></Script>    <Scriptsrc=".. /js/jsxtransformer.js "></Script>    <Scriptsrc=".. /js/react-0.13.4.min.js "></Script>    <Scriptsrc=".. /js/react-dom-0.14.0.js "></Script></Head><Body><DivID= "Content"></Div><Scriptsrc=".. /component/commentbox.js "type= "TEXT/JSX"></Script></Body></HTML>

Commentbox.js

var Commentbox = React.createclass ({    function() {        return  (            <div classname= "Commentbox" >                Hello,world!  I am a commentbox.             (</div>        );    }}); React.render (    <commentbox/>,    document.getElementById (' content '));

The first thing to note here is because

1.commentbox.js gets the content that has been introduced in the index file Commentbox.js file to be placed behind the content.

2.reactdom.render () is also possible, but to introduce the corresponding react-dom.js file, followed by the version number after 13

3.comment.js file type= ' text/jsx ' If you have introduced a Babel file, you can also write Text/babel. Babel.js and Jsxtransformer.js are interchangeable, and the corresponding type is changed to JSX or Babel.

Reacto Small Project

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.