Skip to content

Commit 968733d

Browse files
committed
Updated the example so it works
1 parent f3c0f20 commit 968733d

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

examples/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"babel": "babel src --out-dir dist",
88
"build": "npm run babel",
9-
"local": "node dist/index.js"
9+
"local": "npm run build && node dist/index.js"
1010
},
1111
"author": "Adam Bulmer",
1212
"license": "MIT",

examples/express/src/App/Body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react';
22
import { StaticCSS as CSS } from '../../../../dist';
33

4-
function Body() {
4+
function Body(props) {
55
return (
66
<div className="fake-body">
77
<p>
8-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Molestias quas amet omnis laudantium autem. Laboriosam, rerum dolorem nostrum, sint ad nam dolor molestias officia corrupti, assumenda quam? Quae, dolores aliquid.
8+
{props.text}
99
</p>
1010
</div>
1111
);

examples/express/src/App/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import Header from './Header';
33
import Body from './Body';
44
import { StaticCSS as CSS } from '../../../../dist';
55

6-
function Root() {
6+
function Root(props) {
77
return (
88
<React.Fragment>
99
<Header />
1010
<div>
11-
<Body />
11+
<Body text={props.bodyText}/>
1212
</div>
1313
</React.Fragment>
1414
);

examples/express/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { Resolver, FileSystemAdapter } from '../../../dist/index';
88
const app = express();
99

1010
app.get('/', (req, res) => {
11-
const htmlBody = ReactDOMServer.renderToString(React.createElement(App));
11+
const htmlBody = ReactDOMServer.renderToString(React.createElement(App, {
12+
bodyText: 'hello world, from the server yo',
13+
}));
14+
1215
const resolver = new Resolver(App, new FileSystemAdapter({
1316
folderPath: `${path}/styles`,
1417
inline: true,

0 commit comments

Comments
 (0)