preactjs/preact-router

Sorting routes by rank

Open

#63 aperta il 17 ago 2016

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (152 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (1055 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

<Router> component now sorts routes by count of path segments or by path string length as a fallback.

Maybe it would helpful allow programmers to specify rank explicitly?

This can be done with new rank attribute for route component. Or with using key attribute as rank. Or with preserving order of <Router> component children when counts of path segments are equal (stable sort).

Guida contributor