DEMO
null

useLocation

Reactive browser location.

Usage

import { useLocation } from '@react-hooks-library/core'

export function Demo() {
  const router = useLocation()

  return (
    <div>
      <pre>
        <code>{JSON.stringify(router, null, 2)}</code>
      </pre>
    </div>
  )
}

Type Declarations

interface Location {
  trigger: string
  state?: any
  length?: number
  hash?: string
  host?: string
  hostname?: string
  href?: string
  origin?: string
  pathname?: string
  port?: string
  protocol?: string
  search?: string
}
/**
 * Reactive browser location.
 *
 * @see https://react-hooks-library.vercel.app/core/useLocation
 *
 */
declare function useLocation(): Location | null

Source

Source | Demo | Docs