This is created as an issue as per suggestion by @mc1098 in #2107.
Feel free to move this to discussion if not appropriate.
This issue proposes the following changes to yew-router:
- Add a
<Redirect<R> to={route} /> component to yew-router that mirrors react-router's <Redirect /> component.
- Rename prop
route to to for <Link /> so it is consistent with <Redirect />.
- Make
<Router /> a context provider
- Add
Location and History that mirrors the behaviour of history package on npm.
- Introduce
use_history, use_location and use_route hook.
- Introduce a
RouterScopeExt that provides history location and route methods on ctx.link().
I have a custom fork that have some of the changes implemented but that branch also contains changes proposed in #2107.
I will file a PR for this issue after #2107 is settled.
This is created as an issue as per suggestion by @mc1098 in #2107.
Feel free to move this to discussion if not appropriate.
This issue proposes the following changes to
yew-router:<Redirect<R> to={route} />component toyew-routerthat mirrorsreact-router's<Redirect />component.routetotofor<Link />so it is consistent with<Redirect />.<Router />a context providerLocationandHistorythat mirrors the behaviour ofhistorypackage onnpm.use_history,use_locationanduse_routehook.RouterScopeExtthat provideshistorylocationandroutemethods onctx.link().I have a custom fork that have some of the changes implemented but that branch also contains changes proposed in #2107.
I will file a PR for this issue after #2107 is settled.