Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit documentation #143

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading