Skip to content

Commit 5991721

Browse files
authored
Merge pull request #3 from gigantz/ojr/update-examples
Update examples
2 parents 96bb69e + 1a1ff93 commit 5991721

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ExpressApp = () => (
4040
</App>
4141
);
4242

43-
ReactExpress.render(<ExpressApp />);
43+
ReactXpress.render(<ExpressApp />);
4444
```
4545

4646
### How to use

examples/advanced/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import React from "react";
2-
import ReactExpress from "../../src/renderer";
2+
import { ReactXpress, App, Static, Router, Get } from "../../lib";
33
import { postHandler, postsHandler } from "./handlers";
44

55
const ExpressApp = () => (
6-
<app port={8080}>
7-
<static publicPath="/public" />
8-
<router path="/">
9-
<get path="/posts" handler={postsHandler} />
10-
<get path="/posts/:id" handler={postHandler} />
11-
<get path="*" content="Not Found" status={404} />
12-
</router>
13-
</app>
6+
<App port={8080}>
7+
<Static publicPath="/public" />
8+
<Router path="/">
9+
<Get path="/posts" handler={postsHandler} />
10+
<Get path="/posts/:id" handler={postHandler} />
11+
<Get path="*" content="Not Found" status={404} />
12+
</Router>
13+
</App>
1414
);
1515

16-
ReactExpress.render(<ExpressApp />);
16+
ReactXpress.render(<ExpressApp />);

examples/basic/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import React from "react";
2-
import ReactExpress from "./src/renderer";
2+
import { ReactXpress, App, Static, Router, Get } from "../../lib";
33

44
const ExpressApp = () => (
5-
<app port={8080}>
6-
<static publicPath="/public" />
7-
<router path="/">
8-
<get
5+
<App port={8080}>
6+
<Static publicPath="/public" />
7+
<Router path="/">
8+
<Get
99
content={() => (
1010
<div>
1111
<h1>Hello World</h1>
1212
</div>
1313
)}
1414
/>
15-
<get path="*" content="Not Found" status={404} />
16-
</router>
17-
</app>
15+
<Get path="*" content="Not Found" status={404} />
16+
</Router>
17+
</App>
1818
);
1919

20-
ReactExpress.render(<ExpressApp />);
20+
ReactXpress.render(<ExpressApp />);

src/pages/ComponentsPage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ export const ComponentsPage = () => {
1313
<h1>Components</h1>
1414
<p>
1515
<p>
16-
<span>{`<app />`}</span> - App Instance (props: port)
16+
<span>{`<App />`}</span> - App Instance (props: port)
1717
</p>
1818
<p>
19-
<span>{`<static />`}</span> - Static route (props: publicPath, path,
19+
<span>{`<Static />`}</span> - Static route (props: publicPath, path,
2020
options)
2121
</p>
2222
<p>
23-
<span>{`<router />`}</span> - Router-Provider (props: path)
23+
<span>{`<Router />`}</span> - Router-Provider (props: path)
2424
</p>
2525
<p>
26-
<span>{`<get />, <post /> and ...`}</span> - Route component (props:
26+
<span>{`<Get />, <Post /> and ...`}</span> - Route component (props:
2727
path, content, handler, status)
2828
</p>
2929
</p>

0 commit comments

Comments
 (0)