0.1.3 • Published 6 years ago
create-navigation v0.1.3
Getting started
create-navigation is a basic yet amazing component to make routing an easy task. First of all, install it into your project using npm or yarn:
npm install create-navigation --save
yarn add create-navigation
Import create-navigation into your application and start routing:
import createNavigation, { withRouter } from 'create-navigation';
import { Home, About, Login } from './my-awesome-views';
const App = () => {
return withRouter(
createNavigation({
Home: {
path: '/home',
component: <Home props="foo" />,
},
About: {
restrict: true,
component: <About />,
},
Login: {
path: '/',
exact: true,
component: <Login />,
},
})
);
};
export default App;
That's it! Now just access the path of the components and see them being rendered.
Documentation
Authors
- Gabriel Pereira - gabepereira