1.0.1 • Published 4 years ago

@dev_hills/easyroute v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

easyroute

simplifies page routing

NPM JavaScript Style Guide

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