Stellar, statically typed, declarative routing for react.
npm install alnilam⭐ 🌟 ⭐
It's a fork of react-router-dom in TypeScript. You can find the differences to RR 5.0 here.
Motivations:
1. No more split between core library and dom. This makes the whole thing a lot easier to understand.
2. No more react native support. A necessity of point one, but also motivated by the low download count of RR native.
3. Streamlining: Removing MemoryRouter, HashRouter, BrowserRouter. Those just wrapped ```.`
4. Break things the original can't because it would require major releases:
* Dropping exports
* Upping the minimum react version.
* Changing key behaviors (like Route`)
5. Port the entire thing to typescript.
6. Break from some minor decisions made for RR.
Ultimately, it's more about the learning experience. It's my first dabble with a library, typescript and publishing something on NPM. Alnilam also serves as my testbed for contributions back to RR.
Thanks to all original contributors of React-Router.
You can find the documenation here.
`npm i alnilam`
`jsx
// Minimal example using the browser history API.
import { Router, Switch, Route } from "alnilam";
import { createBrowserHistory } from "verlauf";
const myHistory = createBrowserHistory(/ consult the history documentation for your options here/);
function MyRouter() {
return (
/ Setting up the router itself. /
{/ Switch will only render the first matching route: /}
{/ Defining the individual routes: /}
Epsilon Orionis
Zeta Orionis
Delta Orionis
Home of Bill.
);
}
`
Here is a a small example app made with Alnilam. It shows:
* Nested routes
* Basic use of ``, ``, ``, and ```
* Use of parameters in route declarations
* [x] Outline (or implement) API changes and refactorings for future work.
* [x] Document the API differences properly in a separate document.
* [ ] Figure out proper typing for withRouter()
Alnilam is a star that was used in celestial
navigation. It's one of the stars in Orions belt - which happens to be my
favorite constellation - and it's official designation is Epsilon Orionis.
I'm also a fan of contrived package names ;-)