easyroute
simplifies page routing
Install
npm install --save @dev_hills/easyroute
yarn add @dev_hills/easyroute
Usage
import React from 'react'
import ReactDOM from 'react-dom'
import { Easyroute } from "@dev_hills/easyroute";
import About from "./About"
import Contact from "./Contact";
let list =[{path:"/" ,component:Home},{path:"/about" ,component:About}]
/* list is an array of objects ,each object in the array should hold a path and component property name */
/*Home and About should be already created component you want to route to ,you can create any number of page routes */
/*Easyroute accepts an arr prop which is of proptype array */
ReactDOM.render(
<Easyroute arr={list} />
, document.getElementById('root'))
License
MIT © hills2003