Skip to content

Commit

Permalink
Review types (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy Brauner authored Oct 18, 2023
1 parent 43c7879 commit f1ded44
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center" style="text-align:center">🚃<br>cher-ami router</h1>

<p align="center">
A fresh react router designed for flexible route transitions
A fresh high-level react router designed for flexible route transitions
<br>
<br>
<img alt="npm" src="https://img.shields.io/npm/v/@cher-ami/router">
Expand All @@ -13,8 +13,7 @@ A fresh react router designed for flexible route transitions
cher-ami router API is inspired by [wouter](https://github.com/molefrog/wouter),
[solidify router](https://github.com/solid-js/solidify/blob/master/navigation/Router.ts)
and
[vue router](https://router.vuejs.org/) API. This repository started from a copy
of [willybrauner/react-router](https://github.com/willybrauner/react-router/).
[vue router](https://router.vuejs.org/) API.

## Why another react router?

Expand Down Expand Up @@ -499,7 +498,7 @@ const router = useRouter();
```ts
// previousRoute and currentRoute
type TRoute = {
type TRoute = Partial<{
path: string | { [x: string]: string };
component: React.ComponentType<any>;
base: string;
Expand All @@ -508,12 +507,15 @@ type TRoute = {
props: TRouteProps;
children: TRoute[];
url: string;
getStaticProps: (props: TRouteProps) => Promise<any>;
_fullUrl: string; // full URL who not depend of current instance
params?: TParams;
queryParams?: TQueryParams;
hash?: string;
getStaticProps: (props: TRouteProps, currentLang: TLanguage) => Promise<any>;
_fullUrl: string; // full URL who not depends on current instance
_fullPath: string; // full Path /base/:lang/foo/second-foo
_langPath: { [x: string]: string } | null;
_context: TRoute;
};
}>;
```
### <a name="useLocation"></a>useLocation
Expand All @@ -538,7 +540,9 @@ An array with these properties:
```ts
type TOpenRouteParams = {
name: string;
params?: { [x: string]: any };
params?: TParams;
queryParams?: TQueryParams;
hash?: string;
};
```
Expand Down

0 comments on commit f1ded44

Please sign in to comment.