Gathering detailed insights and metrics for @kikobeats/use-query-state
Gathering detailed insights and metrics for @kikobeats/use-query-state
Gathering detailed insights and metrics for @kikobeats/use-query-state
Gathering detailed insights and metrics for @kikobeats/use-query-state
React hook to set/retrieve state from URL query string.
npm install @kikobeats/use-query-state
Typescript
Module System
Min. Node Version
Node Version
NPM Version
61.2
Supply Chain
80.6
Quality
75.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
49 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Oct 19, 2022
Latest Version
1.2.2
Package Id
@kikobeats/use-query-state@1.2.2
Unpacked Size
6.83 kB
Size
2.98 kB
File Count
6
NPM Version
8.19.2
Node Version
18.12.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
React hook for sharing state via URL.
1$ npm install @Kikobeats/use-query-state --save
Just get it from window.location.search
1const [query, setQuery] = useQueryState()
This is especially useful for Server-side Rendering (SSR), when the initial query state will depends on the incoming request.
1const [query, setQuery] = useQueryState(ssrQuery)
Sometimes you want to modify the window.location.search
for anything you need for.
1const safeDecode = value => { 2 try { 3 return decodeURIComponent(value) 4 } catch (_) { 5 return value 6 } 7} 8 9const [query, setQuery] = useQueryState(undefined, parsedQuery => 10 Object.entries(parsedQuery).reduce((acc, [key, value]) => { 11 acc[key] = safeDecode(value) 12 return acc 13 }, {}) 14)
Since Next.js doesn't support ES Modules yet, you need to install next-transpile-modules
in order to make possible use the hook on Next.js:
1const withTM = require('next-transpile-modules')(['@kikobeats/use-query-state']) 2 3const nextConfig = {} 4 5module.exports = withTM(withOffline(nextConfig))
1import useQueryState from '@kikobeats/use-query-state/gatsby'
use-query-state © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/28 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More