0.0.1 • Published 5 years ago

react-router-ext v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

react-router-ext.

An Extended react-router-dom with simple usage

API

Table of Contents

Usage

An Example usage react-router-ext.

Parameters

Properties

Examples

const routeList = [
 // Basic 
 {
   path: '/',
   component: Home,
   exact: true,
 },
 
 // With Wrapper Component
 {
   path: '/',
   component: Home,
   exact: true,
   wrapper: AuthComponent,
 },

// With Routes
 {
   path: '/',
   component: Home,
   exact: true,
   wrapper: AuthComponent,
   routes: [
     {
       path: '/article',
       component: Article,
       exact: true,
       routes: [
         {
           path: '/categories',
           component: Category,
           exact: true,
         },
       ]
     },
   ]
 }

]

// Render
ReactDOM.render(<MainRoute routes={routeList}/>, node)

Returns ReactElement

Route

Type: Object

Properties

Credits

0.0.1

5 years ago