I am trying the routing example in the Feliz docs, but doesnt seem to route to pages when hitting different paths (/counter, /index and so on) i am using Feliz template V4..
/// <summary>
/// A React component that uses Feliz.Router
/// to determine what to show based on the current URL
/// </summary>
[<ReactComponent>]
static member Router() =
printfn "current path %A" Router.currentPath()
printfn "current url %A" Router.currentUrl()
let (currentUrl, updateUrl) = React.useState(Router.currentUrl())
React.router [
router.onUrlChanged updateUrl
router.children [
do
printfn "routing to url %A" currentUrl
match currentUrl with
| [ ] -> Html.h1 "Index"
| [ "hello" ] -> Components.HelloWorld()
| [ "counter" ] -> Components.Counter()
| _ -> Html.h1 "Not found"
]
]
and then main is the simple one given but replaced the router component in place of the other
I am trying the routing example in the Feliz docs, but doesnt seem to route to pages when hitting different paths (/counter, /index and so on) i am using Feliz template V4..
and then main is the simple one given but replaced the router component in place of the other