https://github.com/zackify/rn-base
Base structure for my react-native apps. Works on iOS and Android
https://github.com/zackify/rn-base
Last synced: 5 months ago
JSON representation
Base structure for my react-native apps. Works on iOS and Android
- Host: GitHub
- URL: https://github.com/zackify/rn-base
- Owner: zackify
- Created: 2016-01-20T00:27:18.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T03:05:44.000Z (about 10 years ago)
- Last Synced: 2025-04-08T07:43:05.340Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rn-base
Base structure for my react-native apps. Works on iOS and Android. Example with a nested navigator:
[](http://www.youtube.com/watch?v=8FxlXHnEKnw "demo")
##Building
In the components folder there are four folders. Each of them are described below.
###Actions
Contains all [redux](http://redux.js.org/) actions
###Reducers
This contains all of the [redux](http://redux.js.org/) reducers required for your app.
###Containers
This folder contains the top level navigator and any needed dependencies for that section. The `root` folder contains `scene.js` which is responsible for handling all the routing at the top level. If has a corresponding `navbar.js` which can be reused later. If you need a nested navigator, say taking a picture is outside of your push and pop route flow, make a new folder here describing that. It will contain a new `scene.js`. This way you can remove a navbar, change it out, or whatever you'd like.
###Sections
The sub folders here are named the same as the containers. This is where you put each page that corresponds to a container. You can push a new container to the main navigator at any time by passing that container's scene component, ex:
```js
import Camera from '../../containers/camera/scene'
...
this.props.navigator.push({
component: Camera,
title: 'Camera',
sceneConfig: Navigator.SceneConfigs.VerticalUpSwipeJump
})
```