useLocation

fun <T> useLocation(select: Select<ParsedLocation, T>, structuralSharing: Boolean): T(source)


Read the current location from the router state with optional selection. Useful for subscribing to just the pieces of location you care about.

Options:

  • select: Project the location object to a derived value

  • structuralSharing: Enable structural sharing for stable references

API Docs

Return

The current location (or selected value).