Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

Conductor is a straightforward routing library for React using browser pushState. 🚃

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"))

```