Skip to content

Commit 26d7324

Browse files
committed
Improve examples (#6)
* fix(*): add missing async lifecycle handlers * feat(examples): improve examples
1 parent 712a84f commit 26d7324

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+459
-719
lines changed

examples/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
*.pdf
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# React Sample
2+
3+
This example demonstrates how **Paprize** works in [React](https://paprize.page/docs/react/quick-start).
4+
5+
## Hot to run
6+
7+
First you need to install dependencies
8+
9+
```bash
10+
npm install
11+
```
12+
13+
this example can be run in both client and server side report [generation mode](https://paprize.page/docs/report-generation).
14+
15+
### Client Side
16+
17+
1. Run the react development server by:
18+
19+
```bash
20+
npm run dev
21+
```
22+
23+
3. Check the output
24+
25+
The generated report can be viewed and printed in the browser.
26+
27+
### Server Side
28+
29+
1. Build the React App
30+
31+
```bash
32+
npm run build
33+
```
34+
35+
2. Run the report generator
36+
37+
```bash
38+
npm run ssg
39+
```
40+
41+
3. Check the output
42+
43+
The generated PDF file will be created in the same folder.
File renamed without changes.
4.59 MB
Binary file not shown.
File renamed without changes.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
},
1212
"dependencies": {
1313
"@paprize/puppeteer": "*",
14-
"@tanstack/react-router": "^1.132.37",
1514
"puppeteer": "^24.23.0",
1615
"react": "^19.2.0",
1716
"react-dom": "^19.2.0",
1817
"recharts": "^3.2.1"
1918
},
2019
"devDependencies": {
2120
"@eslint/js": "^9.37.0",
22-
"@tanstack/router-plugin": "^1.132.37",
2321
"@types/react": "^19.2.0",
2422
"@types/react-dom": "^19.2.0",
2523
"@vitejs/plugin-react-swc": "^4.1.0",
@@ -31,4 +29,4 @@
3129
"typescript-eslint": "^8.45.0",
3230
"vite": "^7.1.12"
3331
}
34-
}
32+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
ReportPreview,
44
Section,
55
PageContent,
6-
pageSize,
76
PageHeader,
87
PageFooter,
98
PageOverlay,
@@ -14,9 +13,10 @@ import Finance from './Finance';
1413
import Business from './Business';
1514
import Footer from './Footer';
1615
import PageBar from './PageBar';
16+
import { pageSize } from '@paprize/core';
1717
import './styles.css';
1818

19-
function MewoCompany() {
19+
function App() {
2020
return (
2121
<ReportRoot>
2222
<ReportPreview>
@@ -49,4 +49,4 @@ function MewoCompany() {
4949
);
5050
}
5151

52-
export default MewoCompany;
52+
export default App;
File renamed without changes.

0 commit comments

Comments
 (0)