From d54e0a496d6e1ee599917daca8f130a3bfe21ac3 Mon Sep 17 00:00:00 2001 From: Alexey Taktarov Date: Fri, 2 Feb 2024 10:08:29 +0100 Subject: [PATCH] Redirect additional nav props. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 0802e09..e09d06b 100644 --- a/README.md +++ b/README.md @@ -472,6 +472,18 @@ When no route in switch matches, the last empty `Route` will be used as a fallba When mounted performs a redirect to a `path` provided. Uses `useLocation` hook internally to trigger the navigation inside of a `useEffect` block. +`Redirect` can also accept props for [customizing how navigation will be performed](#additional-navigation-parameters), for example for setting history state when navigating. These options are specific to the currently used location hook. + +```jsx + + +// arbitrary state object + + +// use `replaceState` + +``` + If you need more advanced logic for navigation, for example, to trigger the redirect inside of an event handler, consider using [`useLocation` hook instead](#uselocation-working-with-the-history):