icestark-router
A router package for @ice/srark
Installation
npm install @ice/stark-router --save
Example
import React from 'react';
import IceStarkRouter from '@ice/stark-router';
class App extends React.Component {
render() {
const routers = [{
path: '/',
key: 'index',
component: () => <div>index page</div>,
exact: true,
}, {
path: '/home',
key: 'home',
component: () => <div>home page</div>,
}, {
path: '/about',
key: 'about',
component: () => <div>about page</div>,
}];
return (
<div>
<IceStarkRouter routers={routers}/>
</div>
);
}
}