useLocation() issue when migrating 4.x.x to 5.x.x
Aftre migrating from 4.x.x to 5.x.x and fixing all typescript issues and applying the manual fixes as per the migration guide, I ended up with an error of
The code that has worked before in 4.x.x and does not work in 5.x.x that is connected to this is:
- I first create a router
https://gist.github.com/andrulonis/c527b6116d69612c93d8d444cb9b6b4e
- then return a RouterProvider with it
- that is then used in the App for everything as normal
- the
As mentioned, this has worked in the same exact way in 4.x.x and in the migration there was nothing mentioned about
useLocation() may be used only in the context of a <Router> component.. The stacktrace is as follows:The code that has worked before in 4.x.x and does not work in 5.x.x that is connected to this is:
- I first create a router
https://gist.github.com/andrulonis/c527b6116d69612c93d8d444cb9b6b4e
- then return a RouterProvider with it
- that is then used in the App for everything as normal
- the
OrganizationalUnitProvider (this is where useList() is called):As mentioned, this has worked in the same exact way in 4.x.x and in the migration there was nothing mentioned about
useLocation() that corresponds to this issue. Help with resolving the error would be greatly appreciated - not sure whether its the new version issue or it is something on my end.
