neouter 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# neouter
|
|
2
|
+
|
|
3
|
+
neouter($/njuːtər/$, ニョーター) is type-safe router for minimalists! (になる予定)
|
|
4
|
+
|
|
5
|
+
**This project is still under development and may be unstable. PLEASE DO NOT USE IT IN PRODUCTION ENVIRONMENTS!!**
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i neouter
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Defining Routes
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { useCreateRoutes } from "neouter";
|
|
19
|
+
|
|
20
|
+
const routes = {
|
|
21
|
+
"/": {
|
|
22
|
+
component: () => <div>Hello!</div>,
|
|
23
|
+
},
|
|
24
|
+
"/about": {
|
|
25
|
+
component: () => <div>About</div>,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const App = () => {
|
|
30
|
+
const { Router } = useCreateRoutes({ routes });
|
|
31
|
+
return <Router />;
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Link
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { Link } from "neouter";
|
|
39
|
+
|
|
40
|
+
export const Page = () => {
|
|
41
|
+
return (
|
|
42
|
+
<div>
|
|
43
|
+
<p>
|
|
44
|
+
neouter is a routing library for people who are obsessed with
|
|
45
|
+
simplicity😄
|
|
46
|
+
</p>
|
|
47
|
+
<Link href="/learn">Learn more</Link>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Contributing
|
|
54
|
+
|
|
55
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|