Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ean Schuessler
/
react-templates-test
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
82fd15bb
authored
2018-01-01 12:28:19 -0600
by
Ean Schuessler
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Basic templating tests
1 parent
ee6ceb67
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
5 deletions
package.json
src/containers/app.js
src/index.html
src/main.js
src/views/home.rt
src/views/input.rt
webpack.config.js
package.json
View file @
82fd15b
...
...
@@ -4,7 +4,7 @@
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"start"
:
"webpack-dev-server --port=
500
0"
,
"start"
:
"webpack-dev-server --port=
801
0"
,
"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"
,
...
...
src/containers/app.js
0 → 100644
View file @
82fd15b
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
src/index.html
View file @
82fd15b
...
...
@@ -3,5 +3,6 @@
<title>
Template Test
</title>
</head>
<body>
<div
id=
"app"
/>
</body>
</html>
...
...
src/main.js
View file @
82fd15b
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'
)
)
...
...
src/views/home.rt
View file @
82fd15b
<div>
<h1>Its home time</h1>
<div rt-stateless>
<h1>The message is <q>{props.message}</q></h1>
{props.input}
</div>
...
...
src/views/input.rt
0 → 100644
View file @
82fd15b
<div>Input <input></div>
webpack.config.js
View file @
82fd15b
...
...
@@ -29,5 +29,6 @@ module.exports = {
new
HtmlWebpackPlugin
({
template
:
'src/index.html'
})
]
],
devtool
:
'sourcemap'
,
}
...
...
Please
register
or
sign in
to post a comment