Closed WallaceKelly closed 2 years ago
Hello @WallaceKelly,
I don't know Feliz.Router well but looking at the error signature Cmd.navigate
seems the right option here.
Router.navigate
seems to return unit
and not a Cmd<'T>
.
I suppose Router.navigate
can be used inside a callback or from the view.
Upon further investigation, I find that this change is a difference between Feliz.Router 2.x and Feliz.Router 3.x.
https://github.com/Zaid-Ajaj/Feliz.Router#migrating-from-2x-to-3x says,
The 3.x release refactored the API... Router.navigate becomes Cmd.navigate for the Elmish variant...
If someone were working through "The Elmish Book", they would not have installed a Feliz.Router 2.x version. The instructions here say to use dotnet add package Feliz.Router
.
I will assemble a PR to reflect Feliz.Router 3.x.
In this code sample from The Elmish Book...
...using the
Router.navigate(...)
methods does not work for me. In contrast, usingCmd.navigate(...)
does work. Do you think this is a bug in the sample? Or something different about my project?Here are my library references:
And my open directives:
I'd be glad to assemble a PR, if the code sample should be corrected.