Riot v4 view router

385 Views Asked by At

I'm wondering what view router to use with Riot v4 since my usual ones don't currently support v4 and no idea when they will.

I've tried riot-router and riot-view-router but no joy as they rely on v3. What is the alternative until a v4 compat module comes about?

cheers

2

There are 2 best solutions below

1
Avi Tshuva On BEST ANSWER

Any router will do. A proper router is (supposed to be) a small, rather simple, independent piece of code that calls a function per url pattern (just like server side ReST router, for instance) basically. The called function can mess with the DOM, with the riot components, generate events - whatever fit your needs.

i myself found such a basic router and improved it and i use it happily in my Riot 4 application.

0
geonanorch On

Update: as of April 2020 you can use @riotjs/route (currently v5.3.1). It is documented on the Riot website as being part of the Riot ecosystem and is meant for Riot v4.