File tree Expand file tree Collapse file tree 2 files changed +59
-1
lines changed Expand file tree Collapse file tree 2 files changed +59
-1
lines changed Original file line number Diff line number Diff line change 16
16
<!--<script type="text/babel" src="scripts/example.js"></script>-->
17
17
<!--<script type="text/babel" src="scripts/tutorial1.js"></script>-->
18
18
<!--<script type="text/babel" src="scripts/tutorial2-3.js"></script>-->
19
- < script type ="text/babel " src ="scripts/tutorial4-5.js "> </ script >
19
+ <!--<script type="text/babel" src="scripts/tutorial4-5.js"></script>-->
20
+ < script type ="text/babel " src ="scripts/tutorial6-7.js "> </ script >
20
21
</ body >
21
22
</ html >
Original file line number Diff line number Diff line change
1
+ /* global React, ReactDOM */
2
+
3
+ var Comment = React . createClass ( {
4
+ rawMarkup : function ( ) {
5
+ var rawMarkup = marked ( this . props . children . toString ( ) , { sanitize : true } ) ;
6
+
7
+ return { __html : rawMarkup } ;
8
+ } ,
9
+ render : function ( ) {
10
+ return (
11
+ < div className = "comment" >
12
+ < h2 className = "commentAuthor" >
13
+ { this . props . author }
14
+ </ h2 >
15
+ < span dangerouslySetInnerHTML = { this . rawMarkup ( ) } />
16
+ </ div >
17
+ ) ;
18
+ }
19
+ } ) ;
20
+
21
+ var CommentList = React . createClass ( {
22
+ render : function ( ) {
23
+ return (
24
+ < div className = "commentList" >
25
+ < Comment author = "Pete Hunt" > This is one comment</ Comment >
26
+ < Comment author = "Jordan Walke" > This is *another* comment</ Comment >
27
+ </ div >
28
+ ) ;
29
+ }
30
+ } ) ;
31
+
32
+ var CommentForm = React . createClass ( {
33
+ render : function ( ) {
34
+ return (
35
+ < div className = "commentForm" >
36
+ Hello, world! I am a CommentForm.
37
+ </ div >
38
+ ) ;
39
+ }
40
+ } ) ;
41
+
42
+ var CommentBox = React . createClass ( {
43
+ render : function ( ) {
44
+ return (
45
+ < div className = "commentBox" >
46
+ < h1 > Comments</ h1 >
47
+ < CommentList />
48
+ < CommentForm />
49
+ </ div >
50
+ ) ;
51
+ }
52
+ } ) ;
53
+
54
+ ReactDOM . render (
55
+ < CommentBox /> ,
56
+ document . getElementById ( 'content' )
57
+ ) ;
You can’t perform that action at this time.
0 commit comments