Commit Graph

2239 Commits

Author SHA1 Message Date
Eric Vicenti
229c9327b7 State persistence (#3716)
Adds a new state persistence mechanisms to all of the navigators via createNavigationContainer

    There are two new props that you can provide to a navigation container: `storageKey` and `renderLoading`.

    `storageKey` is the string key to be used with AsyncStorage while saving and persisting navigation state. To disable persistence, set to null.

    `renderLoading` allows you to render something while the navigator re-hydrates its state and loads its initial URL. By default this returns null, but Expo users will want to render a <AppLoading /> component for smooth app launches

    There is also functionality in this PR to observe errors that come from re-hydrating state, and gracefully recover by dispatching an init action.

    Also this revises the init action to *reset* the navigation state, rather than preserve the previous state.
2018-03-22 22:42:37 -04:00
Eric Vicenti
2419309e04 Implement paths on SwitchRouter (#3806)
* Fix paths overriding in SwitchRouter
2018-03-22 22:41:27 -04:00
Brent Vatne
72b491afb0 Release 2.0.0-beta.3 2018-03-19 16:53:34 -04:00
Brent Vatne
6612f0d2cf Add switch example 2018-03-19 16:52:12 -04:00
Eric Vicenti
0de40c6464 StackRouter to return null on idempotent navigation (#3793)
This new behavior indicates that the action has been handled, but the state has not changed.
2018-03-19 16:46:57 -04:00
Brent Vatne
64e467e465 Release 2.0.0-beta.2 2018-03-19 13:06:49 -04:00
Brent Vatne
9acb411c4d Bump version to 2.0.0-beta.1 2018-03-19 01:36:37 -04:00
Brent Vatne
e05ce7ffa6 Release 2.0.0-beta.0 2018-03-19 00:13:27 -04:00
Brent Vatne
3613ddba82 Release 2.0.7 2018-03-18 22:22:26 -04:00
Eric Vicenti
c888217357 Improve path matching for SwitchRouter and empty paths (#3784) 2018-03-18 22:10:15 -04:00
Brent Vatne
ea1194b823 Add react-native-tabs as export from react-navigation 2018-03-18 17:50:02 -04:00
Eric Vicenti
b6d3f75bf9 Temporarily disable broken test in NavigationPlayground 2018-03-18 12:22:56 -04:00
Brent Vatne
6345902381 Release 2.0.0-alpha.6 2018-03-17 16:27:52 -04:00
Brent Vatne
3e1a722d29 Fix push action -- regressed when making navigate "less pushy" 2018-03-17 16:27:19 -04:00
Brent Vatne
61cb9e342c Remove yarn link in test script 2018-03-16 20:08:47 -04:00
Eric Vicenti
cc043ebe7d Improve consistency of jest version
Hopefully will fix build on Circle
2018-03-16 16:21:17 -07:00
Jakob Murko
f3d39793f7 Prevent duplicate drawer events (#3763) 2018-03-16 23:36:31 +01:00
Brent Vatne
6d786eaa7a Rename 'carefullyGetParent' to 'dangerouslyGetParent' - It is potentially dangerous because screen components may or may not have the expected parent, so depending on anything related to the parent may lead to bugs. You should use carefully because it is dangerous ;) 2018-03-15 16:01:58 -07:00
Brent Vatne
376e29192b Fix TabNavigator related tests 2018-03-15 13:40:29 -07:00
Brent Vatne
d7710bcb87 Deprecate TabNavigator in favor of react-navigation-tabs 2018-03-15 13:31:03 -07:00
Michał Pierzchała
167cde5d17 Fix memory leak in TabView-test.js (#3742) 2018-03-15 20:25:08 +01:00
Brent Vatne
90d3c12c40 Release 2.0.0-alpha.5 2018-03-15 10:57:33 -07:00
Michał Pierzchała
5b16d5bb47 feat(context): refactor passing navigation context (#3668)
* feat(context): refactor passing navigation context

* remove commented code in example

* adjust src/views/withNavigationFocus.js

* refactor stuff

* extract scene to variable

* Add test

* Apply CR comments

* remove junk

* bring back screen mode header
2018-03-15 18:55:00 +01:00
KUBO
d3613e24e7 Remove unuseful SafeAreaView (#3721) 2018-03-16 02:35:02 +09:00
Brent Vatne
0230812671 Update snapshots 2018-03-15 10:33:49 -07:00
Brent Vatne
392f13f6f0 Another fix for frustrating tab bar icon layout issue 2018-03-15 10:19:20 -07:00
Brent Vatne
212c47a8c2 Rename exports for navigators from XNavigator to createXNavigator (#3753) 2018-03-14 23:23:04 -07:00
Brent Vatne
77528a2844 Missed a case where we should not have flexGrow 2018-03-14 21:48:48 -07:00
Brent Vatne
60723df07f Update snapshot 2018-03-14 21:42:39 -07:00
Brent Vatne
9898572e12 Apply horizontal icon style whenever we should use horizontal tabs in icon 2018-03-14 21:30:04 -07:00
Brent Vatne
62dd906ae7 Release 2.0.0-alpha.4 2018-03-14 15:22:14 -07:00
Brent Vatne
af476b6d84 Rename exports for navigators from XNavigator to createXNavigator 2018-03-14 15:21:38 -07:00
Brent Vatne
454cd8a460 Fix back button on modular header 2018-03-14 15:19:03 -07:00
spaceye
375681a0d7 Reworked headerBackImage navigation prop and rendering (#3680)
* Added possibility to provide custom header back button's image, introduced API changes: removed old prop "headerBackImage", added new prop "backImage".

* Code style fixes.

* Renamed showcase file to for more clarity; updated the prop's name as well.

* Removed listeners code from showcase screens.
2018-03-13 23:15:11 +03:00
Vojtech Novak
80bec8d780 fix contribution docs link (#3707) 2018-03-13 21:14:02 +01:00
Vojtech Novak
6d75ac9193 Playground facelift (#3708)
* wip

* fix imports

* use stylesheet for margin

stylesheet now correct

* also remove old headerLeft

* improve header buttons color

* remove ios button margin
2018-03-13 21:13:19 +01:00
Vojtech Novak
8a84f8523b reuse styles (#3725) 2018-03-13 21:05:21 +01:00
Brent Vatne
2e803d725b Release 2.0.0-alpha.3 2018-03-12 16:19:48 -07:00
Brent Vatne
7b9c0cb57e Add lifecycle polyfill and change away from componentWillMount where possible without too much refactoring 2018-03-08 21:30:06 -08:00
Brent Vatne
d9f2f3c2bb Release 2.0.0-alpha.2 2018-03-12 16:01:57 -07:00
Brent Vatne
a0e844e311 Add dismiss helper, made possible by also adding carefullyGetParent (#3669)
* Add dismiss action, made possible by getParentState

* Add dismiss to flow interface

* Don't dispatch an action on dismiss helper if no parent state

* carefullyGetParent instead of getParentState
2018-03-12 16:01:29 -07:00
Brent Vatne
ff844f0ac4 Release 2.0.0-alpha.1 2018-03-12 15:23:38 -07:00
Brent Vatne
5bb048f5c7 Implement "less pushy navigate" RFC 2018-03-12 15:22:51 -07:00
Brent Vatne
ea4cb8f961 Release 2.0.0-alpha.0 2018-03-12 14:24:51 -07:00
Brent Vatne
c17ac83789 Fix tab icon height on horizontal / ipad 2018-03-12 11:10:00 -07:00
Brent Vatne
46e1e6ef30 Make push, pop, and popToTop bubble like navigate (#3617) 2018-03-12 15:06:38 -07:00
Brent Vatne
e871d36942 Use arrow function for isFocused 2018-03-12 09:56:39 -07:00
Brandon Smith
309eba350a Pass initialRouteKey into StackRouter (#3540) (#3702) 2018-03-09 14:32:01 -05:00
Brent Vatne
2dd62a3ac8 Swap addListener out for isFocused prop on ResourceSavingSceneView (#3700) 2018-03-09 10:55:00 -08:00
Brent Vatne
916b40911a Fix TabRouter-test 2018-03-09 10:46:05 -08:00