@ahooksjs/use-url-state

A hook that stores the state into url query parameters.

Usage no npm install needed!

<script type="module">
  import ahooksjsUseUrlState from 'https://cdn.skypack.dev/@ahooksjs/use-url-state';
</script>

README

useUrlState

A hook that stores the state into url query parameters.

Installing

Inside your React project directory, run the following:

yarn add @ahooksjs/use-url-state -S

Or with npm:

npm install @ahooksjs/use-url-state -S

Example

import useUrlState from '@ahooksjs/use-url-state';

const [state, setState] = useUrlState({ demoCount: '1' });

Documentation

https://ahooks.js.org/hooks/state/use-url-state