1.0.8 • Published 6 years ago
react-router-4-compat v1.0.8
react-router-4-compat ·
A wrapped version compatible with version 3 for React-Router-4. This project is based on react router 4. So you can use any react router 4 component together with this library.
Installation
Using npm:
$ npm install --save react-router-4-compat
import { Router4Compat as Router } from 'react-router-4-compat';
const Demo = () => {
const App = ({ children }) => (
<div>
<h1>App</h1>
<ul>
<li><Link to="/about">About</Link></li>
<li><Link to="/inbox">Inbox</Link></li>
</ul>
{children}
</div>
);
const About = () => <h3>About</h3>;
const Inbox = ({ children }) => (
<div>
<h2>Inbox</h2>
{children || 'Welcome to your Inbox'}
</div>
);
const Message = ({ params }) => <h3>Message {params.id}</h3>;
const routes = {
path: '/',
component: App,
childRoutes: [
{
path: 'about',
component: About,
},
{
path: 'inbox',
component: Inbox,
childRoutes: [{
path: 'messages/:id',
component: Message,
}],
},
],
};
return <Router routes={routes} history={createBrowserHistory('/')} />;
}
Progress
- Only plain route config is supported at this moment.
- static and Dynamic route config have all been supported.
- components and getComponents are supported, but without test.
- components and getComponents are not permitted in the root route config.
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.1.8
6 years ago
0.1.7
6 years ago
0.1.6
6 years ago
0.1.5
6 years ago
0.1.4
6 years ago
0.1.3
6 years ago
0.1.2
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago