react-native-navigation的迁移库
Daniel Zlotin 655dc6bbd1 fix #1803 7 yıl önce
.github update remx 7 yıl önce
AndroidE2E \#1790 7 yıl önce
docs Update _sidebar.md (#1796) 7 yıl önce
e2e fix #1803 7 yıl önce
integration add redux integration tests \#1649 7 yıl önce
lib \#1605 7 yıl önce
playground fix #1803 7 yıl önce
scripts Revert "remove fbsimctl" 7 yıl önce
.gitignore update gitignore 8 yıl önce
.npmignore update npmignore 7 yıl önce
.travis.yml Revert "remove fbsimctl" 7 yıl önce
.watchmanconfig deleted old redux example, using yarn, update package.json to alpha 8 yıl önce
CONTRIBUTING.md Revert "remove fbsimctl" 7 yıl önce
INSTALLING.md removed yarn dependency, npm is fast enough 7 yıl önce
LICENSE Update LICENSE 7 yıl önce
README.md Added v2 docs (#1795) 7 yıl önce
ReactNativeNavigation.podspec update podspec 7 yıl önce
UPDATING.md trigger build 7 yıl önce
index.android.js support react-native start 7 yıl önce
index.ios.js support react-native start 7 yıl önce
jsconfig.json app lifecycle 7 yıl önce
package-lock.json add redux integration tests \#1649 7 yıl önce
package.json add redux integration tests \#1649 7 yıl önce
v1tov2diff.md removed yarn dependency, npm is fast enough 7 yıl önce
wallaby.js fix \#919 7 yıl önce

README.md

Build Status Join us on Discord

React Native Navigation v2 (WIP)

We are rebuilding react-native-navigation

Why Rebuild react-native-navigation?

A New & Improved Core Architecture

react-native-navigation has a few issues which are unsolvable in its current architecture. These issues stem from the same problem: you cannot specify on which screen you wish to make an action. Whenever you want to push a screen, show a modal or any other action, the action defaults to originate from your current screen. In most cases this is fine, but becoms problematic in specific edge cases. For example:

  • What if you want to update your navbar icons and the user pops the screen? Your icons might update on the wrong screen.
  • What if you want to push a screen as a result of a redux action?

There are ways to solve some of these problems in v1 but they are not straightforward. We want to change that.

New API

To solve this problem in v2, every screen receives its containerId as a prop. Whenever you want to perform an action from that screen you need to pass the containerId to the function:

Navigator.pop(this.props.containerId)

Built for Contributors

Currently, it requires a lot of work to accept pull requests. We need to manually make sure that everything works before we approve them because v1 is not thoroughly tested.
v2 is written with contributors in mind from day one.

Written In TDD

v2 is written in Test Driven Development. We have a test for every feature including features that are not implemented yet. This makes accepting pull requests extremely easy: If our tests pass, your pull request is accepted.

Current Status

v2 currently supports most of react-native-navigation’s basic functionality but it is still behind v1. Here is the full comparison of features between v1 and v2 (will be updated regularly):

Top Level API

API v1 v2
startTabBasedApp
startSinglePageApp
registerScreen
drawer

Screen API

 API              v1 v2 iOS v2 Android
push
pop
showModal
popToRoot
resetTo
dismissModal
dismissAllModals
showContextualMenu / Android specific Contribute
dismissContextualMenu / Androic specific Contribute
showFab / Android specific Contribute
dismissFab / Android specific Contribute
showSnackBar / Android specific Contribute
dismissSnackBar / Android specific Contribute
showLightBox Contribute Contribute
dismissLightBox Contribute Contribute
handleDeepLink Contribute Contribute
Screen Visibility

Styles

Note: v1 properties with names beginning with ‘navBar’ are replaced in v2 with properties beginning with ‘topBar’ to avoid confusion with the Android native bottom nav bar.

v1 v2 iOS v2 Android Contributors
topBarTextColor Contribute Wix
topBarTextFontSize Contribute Wix
topBarTextFontFamily Contribute Wix
topBarBackgroundColor Wix
topBarButtonColor Contribute Wix
topBarHidden Contribute Wix
topBarHideOnScroll Contribute Wix
topBarTranslucent Contribute Wix
topBarTransparent WIP @bogobogo Contribute
topBarNoBorder Contribute @gtchance
drawUnderTabBar WIP @gran33 Contribute
drawUnderTopBar WIP @gran33 Contribute
statusBarBlur Contribute @gtchance
topBarBlur Contribute @gtchance
tabBarHidden Contribute @gtchance
statusBarTextColorScheme in development / iOS specific
statusBarTextColorSchemeSingleScreen in development / iOS specific
navBarSubtitleColor Contribute Contribute
navBarSubtitleFontFamily Contribute Contribute
screenBackgroundColor Contribute Wix
orientation Contribute Wix
statusBarHideWithTopBar Contribute @gtchance
statusBarHidden Contribute WIX
disabledBackGesture WIP @gran33 / iOS specific
screenBackgroundImageName Contribute Contribute
rootBackgroundImageName Contribute Contribute
setButtons Contribute @Johan-dutoit
title Wix
toggleDrawer Contribute Contribute
toggleTabs in development in development
setTabBadge Contribute Wix
switchToTab in development Contribute
toggleNavBar WIP @gran33 Contribute
navBarCustomView WIP @gran33 Contribute
customTransition(shared element) :x: WIP @bogobogo Contribute
splitViewScreen :x: Contribute Contribute

Element tranisitions, adding buttons and styles are not yet implemented. Contribute