0.0.28 • Published 8 years ago

react-native-scene-router v0.0.28

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

Scene Router

This package wraps the existing Navigator api from react-native to enable:

  • An arbitrary graph of scenes in json
  • An api for traversing that graph
  • Consistent navigation bar between scenes
  • A menu drawer

These docs provide a high level usage overview. See this sample app for an example usage and see the code (it's not that long).

What is a scene?

A scene is an individual view on the screen of the phone. An app with Scene Router is composed of a graph with scenes as nodes and possible transitions as edges.

RoutableScene

A react component which is a complete scene and aware of the graph. It can trigger transitions between scenes.

Scenes are represented as a stack and transitions either push or pop from the stack.

Types of transition methods available to children:

  • goNext(route = next) - Push a scene to the stack. By default pushes routeLinks['next'] on to the stack but can be used to have multiple next scenes by calling goNext('fancyRoute') which will push routeLinks['fancyRoute'].
  • goBack() - Pop one scene from the stack.
  • goMenu() - Opens the menu drawer if a menu was supplied to the wrapping DrawerNavigator
  • goReturn() - Can return to arbitrary route earlier in the stack or go back any number of scenes.
  • goHome() - Pop to the bottom element of the stack.

DrawerNavigator

Your app's main component should be a drawer navigator which manages rendering the current route.

Props:

  • routeLinks - Links between scenes defining possible transitions.
  • initialRoute - The scene which should be rendered first.
  • renderMenu - Render method which returns menu react component.
0.0.28

8 years ago

0.0.27

8 years ago

0.0.26

8 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.22

8 years ago

0.0.21

8 years ago

0.0.20

8 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago