@dev_hills/easyroute

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @dev_hills/easyroute

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

237 kB

Total Files

7

Last publish

Collaborators

  • dev_hills