82fd15bb by Ean Schuessler

Basic templating tests

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