Hi there, looking to update an old react (kotlin) ...
# getting-started
m
Hi there, looking to update an old react (kotlin) app I started on and I'm stuck on
useLocation() may be used only in the context of a <Router> component
no matter which block I put it in?
Copy code
val App = FC<Props> {
  BrowserRouter {
    Routes {
      Route {
        useLocation() // ...
k
#react
m
Actually figured this out on my own. Some reason I put it in a VFC/FC at the root level (within a BrowserRouter) and it must've not compiled right or something because I immediately moved on but going back to that and... it works! Now I'm just trying to find the best way to do things still as it seems the documentation is more currently for React + Kotlin developers looking to Kotlin their React not so much Kotlin users looking to learn React within Kotlin.
If you will, someone who reads this may have a better idea: anything I should use instead of React since I'm dead-set on being in Kotlin-first? My project is quite small.
l
#compose-web