React sprout

React-sprout is a router for React.

Installation

npm install react-sprout

Usage

import React from 'react';
import Routes from 'react-sprout';

import { createRoot } from 'react-dom/client';

import Home from './home.jsx';
import Todos from './todos.jsx';

let Router = Routes(
	<>
		<Home path="home" />
		<Todos path="todos" />
	</>,
);

function Application() {
	return <Router />;
}

createRoot(document.getElementById('root')).render(<Application />);