@kikobeats/use-query-state

React hook to set/retrieve state from URL query string

Usage no npm install needed!

<script type="module">
  import kikobeatsUseQueryState from 'https://cdn.skypack.dev/@kikobeats/use-query-state';
</script>

README

use-query-state

React hook for sharing state via URL.

Installation

$ npm install @Kikobeats/use-query-state --save

for Next.js

Since Next.js doesn't support ES Modules yet, you need to installt next-transpile-modules in order to make possible use the hook on Next.js:

const withTM = require('next-transpile-modules')(['@kikobeats/use-query-state'])

const nextConfig = {}

module.exports = withTM(withOffline(nextConfig))

for Gatsby

import useQueryState from '@kikobeats/use-query-state/gatsby'

License

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