Skip to content
This repository has been archived by the owner on Aug 20, 2019. It is now read-only.

thewei/react-native-navigator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

react-native-navigator

Build Status npm version NPM downloads

A web like router for ReactNative

Installation

$ npm install react-native-navigator --save

Example

index.ios.js:

'use strict';

import React from 'react-native';
import App from './src/app';

React.AppRegistry.registerComponent('Example', () => App);

app.js:

import React from 'react-native';
import Navigator from 'react-native-navigator';
const {
	Router,
	Route
} = Navigator;

import IndexPage from './pages/IndexPage';
import DocPage from './pages/DocPage';
import DocSection from './pages/DocSection';
import BreadcrumbNavSample from './pages/BreadcrumbNavSample';
import NavigationBarSample from './pages/NavigationBarSample';
import JumpingNavSample from './pages/JumpingNavSample';
import NavSimpleExample from './pages/NavSimpleExample';

// Support params and query
export default class App extends React.Component{
  render() {
    return (
      <Router component={IndexPage} >
      	<Route path="/example/navbar-sample" component={NavigationBarSample} />
      	<Route path="/example/jumping-nav-sample" component={JumpingNavSample} />
      	<Route path="/example/breadcrumb-nav-sample" component={BreadcrumbNavSample} />
      	<Route path="/example/nav-simple-example" component={NavSimpleExample} />
      	<Route path="/doc/:id" component={DocSection} />
      </Router>
    );
  }
};

export default App;

more example pleace checkout the example: Example/index.ios.js

API

  • LinkTo( path, props )
  • Back()

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

About

**[DEPRECATED]** A simple router for react native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published