티스토리 뷰

Language/Node.js

react hello world 출력하기

KyeongRok Kim 2016. 12. 11. 14:17

react hello world 출력하기


메모장에 붙혀넣고 hello.html로 저장하고 웹브라우져로 실행하면 됨

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
    <script type="text/babel">
      
      var Wrapper = React.createClass({
          render:function(){
              return(
                  <div className="wrapper">
                      hello
                  </div>
              )
          }
      });
      
      ReactDOM.render(
          <Wrapper />
          ,document.getElementById('content')
      )
    </script>
    <style>
        .wrapper{
            border: 1px solid black;
            width:600px;
            height:600px;
        }
        
    </style>
</head>
 
<body>
<div id="content"></div>
</body>
</html>
cs

참고:react tutorial

end.



공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함