use-hash
Get and set hash value in url
Import
Source
Docs
Package
Usage
Hook lets you get hash from url, subscribe to its changes with hashchange event and set it:
import { useHash, randomId } from '@mantine/hooks';import { Button } from '@mantine/core';export function Demo() {const [hash, setHash] = useHash();return <Button onClick={() => setHash(randomId())}>Set hash to random string</Button>}
Definition
function useHash(): readonly [string, (value: string) => void];
Built by Vitaly Rtishchev and these awesome people