82fd15bb by Ean Schuessler

Basic templating tests

1 parent ee6ceb67
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 "description": "", 4 "description": "",
5 "main": "index.js", 5 "main": "index.js",
6 "scripts": { 6 "scripts": {
7 "start": "webpack-dev-server --port=5000", 7 "start": "webpack-dev-server --port=8010",
8 "test": "echo \"Error: no test specified\" && exit 1" 8 "test": "echo \"Error: no test specified\" && exit 1"
9 }, 9 },
10 "author": "", 10 "author": "",
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
16 "babel-preset-react": "^6.24.1", 16 "babel-preset-react": "^6.24.1",
17 "external-jsx-loader": "^1.1.0", 17 "external-jsx-loader": "^1.1.0",
18 "html-webpack-plugin": "^2.30.1", 18 "html-webpack-plugin": "^2.30.1",
19 "react": "^16.2.0",
20 "react-dom": "^16.2.0",
19 "react-templates": "^0.6.1", 21 "react-templates": "^0.6.1",
20 "react-templates-loader": "^0.6.3", 22 "react-templates-loader": "^0.6.3",
21 "webpack": "^3.10.0", 23 "webpack": "^3.10.0",
......
1 import React from 'react'
2 import HomeView from '../views/home.rt'
3 import InputView from '../views/input.rt'
4
5 class App extends React.Component {
6 render() {
7 const {message} = this.props
8 return (
9 <HomeView message={message} input={<InputView />}/>
10 )
11 }
12 }
13
14 export default App
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
3 <title>Template Test</title> 3 <title>Template Test</title>
4 </head> 4 </head>
5 <body> 5 <body>
6 <div id="app" />
6 </body> 7 </body>
7 </html> 8 </html>
......
1 console.log('This is main'); 1 import React from 'react'
2 import ReactDOM from 'react-dom'
3
4 import App from './containers/app'
5
6 ReactDOM.render(
7 <App message="Hello" />,
8 document.getElementById('app')
9 )
......
1 <div> 1 <div rt-stateless>
2 <h1>Its home time</h1> 2 <h1>The message is <q>{props.message}</q></h1>
3 {props.input}
3 </div> 4 </div>
......
1 <div>Input <input></div>
...@@ -29,5 +29,6 @@ module.exports = { ...@@ -29,5 +29,6 @@ module.exports = {
29 new HtmlWebpackPlugin({ 29 new HtmlWebpackPlugin({
30 template: 'src/index.html' 30 template: 'src/index.html'
31 }) 31 })
32 ] 32 ],
33 devtool: 'sourcemap',
33 } 34 }
......