Skip to content

Commit 3f8369b

Browse files
committed
Migrate examples to Vite and trim legacy routers
1 parent bef8714 commit 3f8369b

File tree

117 files changed

+411
-1103
lines changed

Some content is hidden

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

117 files changed

+411
-1103
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ render(<Enhanced isAnimating />, document.getElementById('root'))
100100
- Next Pages Router: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/next-pages-router) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/next-pages-router)
101101
- Original Design: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/original-design) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/original-design)
102102
- Plain JS: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/plain-js) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/plain-js)
103-
- Reach Router: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/reach-router) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/reach-router)
104-
- React Router V5: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/react-router-v5) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/react-router-v5)
105103
- React Router V6: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/react-router-v6) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/react-router-v6)
106104
- Render Props: [Source](https://github.com/tanem/react-nprogress/tree/master/examples/render-props) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/render-props)
107105
- UMD Build (Development): [Source](https://github.com/tanem/react-nprogress/tree/master/examples/umd-dev) | [Sandbox](https://codesandbox.io/s/github/tanem/react-nprogress/tree/master/examples/umd-dev)

examples/hoc/.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/hoc/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/node_modules
1+
node_modules
2+
dist

examples/hoc/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# ReactNProgress HOC Example
22

3-
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
4-
53
## Available Scripts
64

7-
In the project directory, you can run:
5+
### `npm run dev`
6+
7+
Runs the app in development mode.
8+
9+
### `npm run build`
810

9-
### `npm start`
11+
Builds the app for production.
1012

11-
Runs the app in the development mode.<br>
12-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
### `npm run preview`
1314

14-
The page will reload if you make edits.<br>
15-
You will also see any lint errors in the console.
15+
Previews the production build locally.

examples/hoc/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>ReactNProgress HOC Example</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/main.tsx"></script>
11+
</body>
12+
</html>

examples/hoc/package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66
],
77
"version": "0.1.0",
88
"private": true,
9+
"type": "module",
910
"dependencies": {
1011
"@tanem/react-nprogress": "latest",
11-
"@types/node": "24.10.13",
12+
"react": "19.2.4",
13+
"react-dom": "19.2.4"
14+
},
15+
"devDependencies": {
1216
"@types/react": "19.2.14",
1317
"@types/react-dom": "19.2.3",
14-
"react": "19.2.4",
15-
"react-dom": "19.2.4",
16-
"react-scripts": "5.0.1",
17-
"typescript": "4.9.5"
18+
"@vitejs/plugin-react": "5.1.4",
19+
"typescript": "5.9.3",
20+
"vite": "7.3.1"
1821
},
1922
"scripts": {
20-
"start": "react-scripts start"
21-
},
22-
"browserslist": [
23-
">0.2%",
24-
"not dead",
25-
"not ie <= 11",
26-
"not op_mini all"
27-
]
23+
"dev": "vite",
24+
"build": "tsc -b && vite build",
25+
"preview": "vite preview"
26+
}
2827
}

examples/hoc/public/index.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

examples/hoc/src/Bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react'
1+
import type { FC } from 'react'
22

3-
const Bar: React.FC<{ animationDuration: number; progress: number }> = ({
3+
const Bar: FC<{ animationDuration: number; progress: number }> = ({
44
animationDuration,
55
progress,
66
}) => (

examples/hoc/src/Container.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import React from 'react'
1+
import type { FC, PropsWithChildren } from 'react'
22

3-
const Container: React.FC<{
4-
animationDuration: number
5-
isFinished: boolean
6-
}> = ({ animationDuration, children, isFinished }) => (
3+
const Container: FC<
4+
PropsWithChildren<{
5+
animationDuration: number
6+
isFinished: boolean
7+
}>
8+
> = ({ animationDuration, children, isFinished }) => (
79
<div
810
style={{
911
opacity: isFinished ? 0 : 1,

examples/hoc/src/Progress.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { withNProgress } from '@tanem/react-nprogress'
2-
import React from 'react'
2+
import type { FC } from 'react'
33

44
import Bar from './Bar'
55
import Container from './Container'
66
import Spinner from './Spinner'
77

8-
const Progress: React.FC<{
8+
const Progress: FC<{
99
animationDuration: number
1010
isFinished: boolean
1111
progress: number

0 commit comments

Comments
 (0)