Skip to content

Commit 19b5f63

Browse files
author
aksonov
committed
2 parents 47a7e0b + 7b32901 commit 19b5f63

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Actions.refresh({param1: 'hello', param2: 'world'})
5252

5353
```bash
5454
# Get the code
55-
git clone [email protected]:aksonov/react-native-router-flux.git`
55+
git clone [email protected]:aksonov/react-native-router-flux.git
5656
cd react-native-router-flux/Example
5757

5858
# Install dependencies

dist/Router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ if(!_navigationStore2.default.states[key]){
238238
_navigationStore2.default.states[key]={};
239239
}
240240
for(var _iterator4=Object.keys(props),_isArray4=Array.isArray(_iterator4),_i5=0,_iterator4=_isArray4?_iterator4:_iterator4[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var _ref8;if(_isArray4){if(_i5>=_iterator4.length)break;_ref8=_iterator4[_i5++];}else{_i5=_iterator4.next();if(_i5.done)break;_ref8=_i5.value;}var transition=_ref8;
241-
if(reservedKeys.indexOf(transition)===-1&&transition[props]instanceof Function){
242-
_navigationStore2.default.states[key][transition]=transition[props];
241+
if(reservedKeys.indexOf(transition)===-1&&props[transition]instanceof Function){
242+
_navigationStore2.default.states[key][transition]=props[transition];
243243
}
244244
}
245245
delete props.children;

docs/MIGRATION.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Migrating from 3.x
1+
## Migrating from 3.x
22

3-
## Breaking changes (compared to v3):
43
* `Actions.create` (alternative syntax to define scenes) is not available (for simplicity) - just use `<Router>` as top component for your App. You may wrap it with Redux as well.
54
* No `duration`/`panHandlers` support - you have to implement custom navigator now instead and pass it as ‘navigator’ prop
65
https://reactnavigation.org/docs/navigators/custom. You could still pass `panHandlers={null}` to disable gestures or `gesturedEnabled={false}`
@@ -12,10 +11,13 @@ https://github.com/react-community/react-navigation/issues/1493
1211
* `Switch` is removed - you may use onEnter/onExit handlers for more flexible logic.
1312
* `getSceneStyle` is removed (no needed in v4, you may pass any values to Router now and they will be inherited by all scenes).
1413
* Custom reducer is supported (`createReducer` prop for Router) but Redux actions now are passed directly from React Navigation (‘Navigation/BACK’, ‘Navigation/NAVIGATE’, etc.)
15-
* Drawer is 'drawer' attribute Scene
14+
* Use 'replace' instead of `ActionConst.REPLACE` within Scene declaration
15+
* Scenes cannot have both 'component' and 'children'
16+
* Drawer syntax was changed (boolean `drawer` attribute + `contentComponent` for side menu component + `Actions.drawerOpen`/`Actions.drawerClose` to open/close drawer)
1617
* Modal is 'lightbox' attribute for Scene (used for popups, like Error)
1718
* Container scenes (that has children) cannot have `component` (or it will be considered as child!). If you want to customize containers, use react navigation custom navigators and pass it as `navigator` prop.
1819
* No `position` attribute is supported for custom transitions. For vertical transition add `modal` to parent `Scene`.
1920
* No flux 'focus' actions - use onEnter/onExit handlers instead.
2021
* tabBarSelectedItemStyle is not supported. Instead please use React Navigation TabBar params for tabs Scene: `activeTintColor`, `inactiveTintColor`, etc (https://reactnavigation.org/docs/navigators/tab)
22+
* To make multiple pops you could use `Actions.popTo(sceneName)` where sceneName is name of scene you want to see (it should be not container, i.e. scene with `component`)
2123
* Possible other stuff.

src/Router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ function processScene(scene: Scene, inheritProps = {}, clones = [], wrapBy) {
238238
navigationStore.states[key] = {};
239239
}
240240
for (const transition of Object.keys(props)) {
241-
if (reservedKeys.indexOf(transition) === -1 && (transition[props] instanceof Function)) {
242-
navigationStore.states[key][transition] = transition[props];
241+
if (reservedKeys.indexOf(transition) === -1 && (props[transition] instanceof Function)) {
242+
navigationStore.states[key][transition] = props[transition];
243243
}
244244
}
245245
delete props.children;

0 commit comments

Comments
 (0)