File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33* HTML template engine: nashorn(react-dom-server)
44* dynamic html: react js
55
6+ ![ capture] ( https://raw.githubusercontent.com/tinywind/REACT-PRACTICE-WEB/master/capture.png " comment ")
7+
8+
69# How to Run
710* run se.olapetersson.ReactiveApplication.class
811* add lobby: http://localhost:8080/lobbies/{lobby-name}
1417* jpa
1518* h2 database
1619* react js
17-
1820* babel-gen: https://github.com/tinywind/BABEL-CODEGEN
19-
20- ** _ BABEL-CODEGEN_ is not deployed to public maven repository, yet.**
21-
21+ ** _ BABEL-CODEGEN_ is not deployed to public maven repository, yet.**
2222* lombok
23-
24- ** If fail compile on any IDE, you check the IDE support _ lombok_ .**
23+ ** If fail compile on any IDE, you check the IDE support _ lombok_ .**
2524
2625# References
2726* http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ var Head = React.createClass({
1313 < script src = "/webjars/react/15.1.0/react.min.js" > </ script >
1414 < script src = "/webjars/react/15.1.0/react-dom.min.js" > </ script >
1515 < script src = "/webjars/requirejs-babel/0.0.8/babel-5.8.22.min.js" > </ script >
16+ < script src = "/js/doms.js" > </ script >
17+ < script src = "/js/playfield.js" > </ script >
1618 </ head >
1719 )
1820 }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ var LobbyCard = React.createClass({
33 var title = this . props . title ;
44 return (
55 < div className = "jumbotron" >
6- < h3 > { title } </ h3 >
6+ < h5 > { title } </ h5 >
77 </ div >
88 ) ;
99 }
@@ -54,7 +54,7 @@ var PlayField = React.createClass({
5454 }
5555 return (
5656 < div className = "jumbotron container-fluid" >
57- < h2 > Lobbies</ h2 >
57+ < h4 > Lobbies</ h4 >
5858 { lobbies }
5959 </ div >
6060 ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ var Comment = React.createClass({
22 render : function ( ) {
33 return (
44 < div >
5- < h2 > { this . props . author } </ h2 >
5+ < h4 > { this . props . author } </ h4 >
66 < p > { this . props . content } </ p >
77 </ div >
88 )
@@ -24,29 +24,26 @@ var CommentList = React.createClass({
2424} ) ;
2525
2626React . createClass ( {
27- containerConstructorString : function ( ) {
28- return "ReactDOM.render(<PlayField />, document.getElementById('container'))" ;
29- } ,
27+ containerConstructorString : "ReactDOM.render(<PlayField />, document.getElementById('container'));" ,
3028 render : function ( ) {
29+ var style = { padding : '1em' } ;
3130 return (
3231 < html >
3332 < Head title = { this . props . title } />
3433 < body >
35- < div >
36- < h1 > Render on Server side </ h1 >
34+ < h1 > Render on Server side </ h1 >
35+ < div style = { style } >
3736 < PlayField />
3837 < CommentList comments = { this . props . comments } />
3938 </ div >
4039 < hr />
4140 < hr />
42- < div >
43- < h1 > Render on Client side </ h1 >
41+ < h1 > Render on Client side </ h1 >
42+ < div style = { style } >
4443 < div id = "container" >
4544 "Not React Rendering"
4645 </ div >
47- < script type = "text/babel" >
48- { this . containerConstructorString ( ) }
49- </ script >
46+ < script type = "text/babel" dangerouslySetInnerHTML = { { __html :this . containerConstructorString } } > </ script >
5047 </ div >
5148 </ body >
5249 </ html >
You can’t perform that action at this time.
0 commit comments