1.4.2 • Published 3 years ago
react-router4-with-layouts v1.4.2
react-router4-with-layouts
Allow Router to have layout prop with typescript definitions
Install
yarn add react-router4-with-layouts
Usage more info
import React, { Component } from 'react';
import { Route } from 'react-router4-with-layouts';
import { Router, Switch } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { DefaultLayout } from './layouts/DefaultLayout';
import { HomePage } from './pages/HomePage';
import { LoginPage } from './pages/LoginPage';
import { EmptyLayout } from './layouts/EmptyLayout';
const history = createBrowserHistory();
export default class App extends Component {
render () {
return (
<Router history={history}>
<Switch>
<Route path="/" component={HomePage} exact layout={DefaultLayout} />
<Route path="/login" component={LoginPage} layout={EmptyLayout} />
</Switch>
</Router>
);
}
}
Todo:
- Add tests
- Refactor example and use StoryBook
- Add travis to publish new releases
- Add changelog
License
MIT © Vytenis Kučiauskas
NOTE Thanks to react-modern-library-boilerplate
1.4.2
3 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.8
6 years ago
1.2.7
6 years ago
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.7
6 years ago
1.1.6
6 years ago
1.1.5
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.2
6 years ago
1.0.0
6 years ago
1.0.9
6 years ago