Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joduplessis/conductor
Conductor is a straightforward routing library for React using browser pushState. 🚃
https://github.com/joduplessis/conductor
react routing typescript
Last synced: 9 days ago
JSON representation
Conductor is a straightforward routing library for React using browser pushState. 🚃
- Host: GitHub
- URL: https://github.com/joduplessis/conductor
- Owner: joduplessis
- License: mit
- Created: 2019-09-18T18:12:25.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-07T06:38:03.000Z (about 5 years ago)
- Last Synced: 2024-09-27T14:34:36.964Z (about 2 months ago)
- Topics: react, routing, typescript
- Language: TypeScript
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Conductor
> Conductor is a straightforward routing library for React using browser pushState, with type support too. Still under development, do not use in production.
## Installation:
```
npm i --save @joduplessis/conductor
```Or you can use the [Yoeman Generator](https://github.com/joduplessis/generator-joduplessis-conductor)
## Some example usage:
```
import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'
import { Route, Routes, navigate } from '@joduplessis/conductor'function HomePage(props) {
return (
Home page
{props.content}
)
}function AboutPage(props) {
return (
About page
{props.content}
)
}function AboutPersonPage(props) {
return (
About Person page
{props.content}
Name: {props.name}
)
}function App(props) {
return (
navigate('/home')}>Home
navigate('/about')}>About
navigate('/about/jo')}>About Jo (URL parameter)
)
}ReactDOM.render(, document.getElementById("root"))
```