Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 503 Bytes

detour.md

File metadata and controls

21 lines (14 loc) · 503 Bytes

detour(parts = [], query = {}, push = true)

Jump to a different location as though a link has been clicked

Syntax

  const onClick = useCallback(() => {
    detour([ 'home' ]);
  }, [ detour ]);

Parameters

  • parts - <string[]> The new path parts
  • query - <object> The new set of query variables
  • push - <boolean> Whether the operation should result in a call to pushState or a replaceState

Notes

Calling this function will trigger detour traps.