state-in-url 3.0.4 → 3.0.5
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 +11 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,14 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<img src="/assets/Logo_big.png?raw=true" alt="state-in-url logo"/>
|
|
5
5
|
|
|
6
|
-
<div>Easily share complex state between unrelated React components,
|
|
6
|
+
<div><h2>Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Without any hasssle or boilerplate.</h2></div>
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<hr />
|
|
11
|
+
|
|
12
|
+
<div align="center">
|
|
13
|
+
<a href="https://github.com/asmyshlyaev177/state-in-url/blob/master/Limits.md" target="_blank">URI size limitation, <b>up to 12KB</b> is safe</a>
|
|
7
14
|
</div>
|
|
8
15
|
|
|
9
16
|
<div align="center">
|
|
@@ -26,7 +33,7 @@ English | [한국어](./README.KO.md) | [简体中文](./README.CN.md)
|
|
|
26
33
|

|
|
27
34
|
|
|
28
35
|
<a href="https://state-in-url-asmyshlyaev177.vercel.app/" target="_blank">DEMO</a> |
|
|
29
|
-
<a href="https://state-in-url.netlify.app/" target="_blank">DEMO2</a>
|
|
36
|
+
<a href="https://state-in-url.netlify.app/" target="_blank">DEMO2</a>
|
|
30
37
|
|
|
31
38
|
<hr />
|
|
32
39
|
|
|
@@ -42,7 +49,7 @@ Share if it useful for you.
|
|
|
42
49
|
|
|
43
50
|
</div>
|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
# Why use state-in-url?
|
|
46
53
|
|
|
47
54
|
`state-in-url` Simple state management with optional URL sync. Good for implementing deep links. Share complex states between unrelated React components, TS-friendly, NextJS compatible. Most of users don't care about URL, so, can use it to store your app state.
|
|
48
55
|
|
|
@@ -103,7 +110,7 @@ pnpm add state-in-url
|
|
|
103
110
|
In `tsconfig.json` in `compilerOptions` set `"moduleResolution": "Bundler"`, or`"moduleResolution": "Node16"`, or `"moduleResolution": "NodeNext"`.
|
|
104
111
|
Possibly need to set `"module": "ES2022"`, or `"module": "ESNext"`
|
|
105
112
|
|
|
106
|
-
|
|
113
|
+
## useUrlState
|
|
107
114
|
|
|
108
115
|
`useUrlState` is a custom React hook for Next.js/React-Router applications that make communication between client components easy. It allows you to share any complex state and sync it with the URL search parameters, providing a way to persist state across page reloads and share application state via URLs.
|
|
109
116
|
|
|
@@ -353,7 +360,6 @@ API is same as for Next.js version, except can pass options from [NavigateOption
|
|
|
353
360
|
|
|
354
361
|
[Docs](packages/urlstate/react-router/useUrlState#api)
|
|
355
362
|
|
|
356
|
-
|
|
357
363
|
### Example
|
|
358
364
|
|
|
359
365
|
```typescript
|
|
@@ -487,7 +493,6 @@ function SettingsComponent() {
|
|
|
487
493
|
|
|
488
494
|
See [Contributing doc](CONTRIBUTING.md)
|
|
489
495
|
|
|
490
|
-
|
|
491
496
|
## Roadmap
|
|
492
497
|
|
|
493
498
|
- [x] hook for `Next.js`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "state-in-url",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.5",
|
|
4
|
+
"description": "Easily share complex state objects between unrelated React components, preserve types and structure, with TS validation. Deep links and url state synchronization wthout any hasssle or boilerplate.",
|
|
5
5
|
"homepage": "https://state-in-url-asmyshlyaev177.vercel.app",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"front-end",
|