715 Commits

Author SHA1 Message Date
Brent Vatne
9a6e0bbd98
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
052d22804c Release 2.0.0-alpha.1 2018-03-12 15:23:38 -07:00
Brent Vatne
7a978b1087 Implement "less pushy navigate" RFC 2018-03-12 15:22:51 -07:00
Brent Vatne
b06fb7e432 Release 2.0.0-alpha.0 2018-03-12 15:06:47 -07:00
Brent Vatne
a92ed83302 Fix tab icon height on horizontal / ipad 2018-03-12 15:06:47 -07:00
Brent Vatne
0c31bc44ea
Make push, pop, and popToTop bubble like navigate (#3617) 2018-03-12 15:06:38 -07:00
Brent Vatne
8e5ee4d312 Use arrow function for isFocused 2018-03-12 09:56:39 -07:00
Brandon Smith
4bb8987ab7 Pass initialRouteKey into StackRouter (#3540) (#3702) 2018-03-09 11:32:01 -08:00
Brent Vatne
81a86fa091
Swap addListener out for isFocused prop on ResourceSavingSceneView (#3700) 2018-03-09 10:55:00 -08:00
Brent Vatne
47f357f332 Fix TabRouter-test 2018-03-09 10:46:05 -08:00
Brent Vatne
bdda6fa5be Add SwitchNavigator to 2.x 2018-03-07 17:35:15 -08:00
Ashoat Tevosyan
b097136f74 [Flow] Some updates, mostly from flow-typed (#3682)
1. Remove `NavigationComponent` from `NavigationScreenRouteConfig`. The only context `NavigationScreenRouteConfig` is used in is as an intersection with an object, and as such the only relevant portions of `NavigationScreenRouteConfig` are the object parts.
2. Add static `HEIGHT` variable to `Header` type.
3. In `NavigationContainerProps`, make `onNavigationStateChange` property value nullable.

PS: if in the future you guys would prefer that I separate these sort of PRs into their constituent parts, let me know.
2018-03-07 11:29:25 -08:00
Ben Styles
c9b0219cec Allow passing null to onNavigationStateChange prop (#3683)
As seen here: react-navigation/react-navigation#360, we need to be able to pass null to turn off logging.
2018-03-07 14:19:00 -05:00
Eric Vicenti
ac83cf804c Fix issue in drawer actions (#3667)
* Fix issue in drawer actions

* Update DrawerView.js
2018-03-06 14:38:03 -08:00
Sirui Li
cf63521516 Flow type: SafeAreaView doesn't require children (#3670)
`children` prop should be optional.
2018-03-06 14:19:46 -08:00
corupta
7c488c8d49 Add activeLabelStyle and inactiveLabelStyle for DrawerItem (#3559)
* Add activeLabelStyle and inactiveLabelStyle

Adding activeLabelStyle, so that active items can be customized more.
My use case: Change font of the active item to bold.
Also, added inactiveLabelStyle which can be used for a similar purpose.

* prettier fix

* Update react-navigation.js

* prettier fix

* Update jest snapshot for DrawerNavigator - for adding a new style property to the styles array
2018-03-05 17:17:08 -08:00
Edward Drapkin
9005494e64 More specific injected Navigation props (#3645) 2018-03-05 16:33:42 -08:00
Brent Vatne
0daab8c55b Add isFocused helper to navigation and fix withNavigationFocus 2018-03-05 12:28:42 -08:00
Brent Vatne
ae98089337 Cache event subscribers and clean up after unmounting (#3648)
* This caches "child event subscribers" by key and removes them when they're not needed anymore. Once a navigator unmounts we also remove upstream subscribers.

* Fix tests
2018-03-05 11:27:57 -08:00
Yordis Prieto
57e37a8783 Fix typespec of back action creator (#3659) 2018-03-05 11:10:39 -08:00
Ashoat Tevosyan
b7994d28db Fix NavigationEventPayload.lastState type (#3664)
Should be nullable, since it is initially called as `null` in `src/createNavigationContainer.js` (and in `react-navigation-redux-helpers`, where it is causing a Flow error)
2018-03-05 11:04:29 -08:00
Vishwesh Jainkuniya
f1bfdeee46 Fix: tabBar icons are not visible. (#3650)
* Fix: tabBar icons are not visible.

* Fix: tests.
2018-03-04 21:21:54 -08:00
Nicolas Beck
c6301abaed Add initialRouteKey for StackRouter (#3540)
* use initialRouteName as key when initializing StackRouter

* fix null headerLeft

* merge back

* fixed tests

* use config flag

* fixed snapshots

* implemented requested changes
2018-03-02 16:06:27 -08:00
Brent Vatne
4569ad49f9 Fix regression in error message for route config validation 2018-03-02 12:18:11 -08:00
Arseny Yankovsky
214eeb13fb Allow modification of SafeAreaView props (#3496)
* SafeAreaView fix

* Updated to only allow modification of forceInset property of SafeAreaView
2018-03-01 13:42:19 -08:00
Michał Pierzchała
416fe58cab Move contributing guide to CONTRIBUTING.md (#3631) 2018-03-01 10:11:30 -08:00
Eric Vicenti
2e47cbb3cb Drawer Router (#3618) 2018-02-27 18:34:05 -08:00
Brent Vatne
cd99dc8054 Update snapshots 2018-02-27 17:32:13 -08:00
Eric Vicenti
e27ad22c57 [BREAKING] New createNavigator API (#3392)
* New createNavigator and View API

See the RFC here:
https://github.com/react-navigation/rfcs/blob/master/text/0002-navigator-view-api.md

* shattered dreams of flow

* fix export

* Fix tab view issues found by brent
2018-02-27 17:27:58 -08:00
Brent Vatne
6785729fb5 Fix snapshots 2018-02-26 16:02:38 -08:00
Brent Vatne
d3b6e70d16 Clarify that people should not report Redux or MobX related integration issues here 2018-02-26 15:53:14 -08:00
Brent Vatne
5f32a48c16 Release 1.2.1 v1.2.1 2018-02-26 14:04:44 -08:00
Brent Vatne
d5a0b5912b Apply StyleSheet.flatten properly to headerStyle. Fixes #3608 2018-02-26 14:04:36 -08:00
Yordis Prieto
13fd8acb20 fix typespec (#3583) 2018-02-26 12:25:13 -08:00
Serhii Palash
8fc8f3b8f7 Fix bug #3279 “Action within RESET doesn't trigger” (#3593)
https://github.com/react-navigation/react-navigation/issues/3279
2018-02-26 12:14:29 -08:00
Brent Vatne
a37473c5e4 Release 1.2.0 v1.2.0 2018-02-25 17:46:44 -08:00
Brent Vatne
23eb0839cb Improve crossfade configuration for header 2018-02-25 17:44:16 -08:00
Brent Vatne
e84473db78
Use a closer-to-correct spring animation when releasing a gesture in CardStack (#3601) 2018-02-25 17:20:39 -08:00
Brent Vatne
c8531d0f38
Pop to top on TabNavigator when tapping already focused tab icon (#3589)
* Pop to top when tapping the tab icon for an already focused tab

* Dispatch popToTop with key to scope the action properly

* Add test for POP_TO_TOP with key
2018-02-25 16:33:20 -08:00
Vojtech Novak
276fb8f7b3 remove support for deprecated navigation actions (#3595)
* remove support for deprecated navigation actions

* remove deprecated action from flow definitions
2018-02-24 12:08:14 -08:00
Johan Ruokangas
ab758bcaaa Fix RFC link (#3594) 2018-02-24 12:50:31 +01:00
Matt Hamil
2bb91a6740 Updated README (#3567)
Changed wording in the Web Support section of README to reflect priority for previous 1.0 release.
2018-02-22 21:52:09 -08:00
Brent Vatne
ffa3a92534
First crack at publish from circle (#3574)
* First crack at publish from circle

* s/publish/deploy

* Update snapshots

* Try installing with yarn

* Nice one

* Shhh

* Comment some things out and add a webhook

* Add proper webhook url and add back build steps
2018-02-22 16:39:41 -08:00
Brent Vatne
6dda8c30a9 Fix colors for card and header border on iOS 2018-02-22 12:58:33 -08:00
Brent Vatne
065fdf61d8
Several improvements to StackNavigation Header (#3568)
* Refactor to remove unused variables, styles, and outer Animated view

* Style cleanup

* Proof of concept blur background

* Clean it up and add flow interface

* Update snapshots
2018-02-21 18:29:43 -08:00
Brent Vatne
371a714b57 Release 1.1.2 v1.1.2 2018-02-20 16:00:44 -08:00
Ron Arts
1d33b95c5f Bump react-native-safe-area-view dep to 0.7.0 for react-native-web support (#3553) 2018-02-20 15:44:20 -08:00
Mike Grabowski
593bc8a648 Improve Header performance a bit (#3556)
* Improve `Header` performance a bit

I have been investigating `<Header />` component performance once again today with `render` cycles in particular. I have observed that during `push` phase, a typical Header in NavigationPlayground re-renders 3 times on iOS and 2 times on Android.

The first time is obvious on both platforms since that's when we add a new scene to an array. Second on iOS was also self-explanatory - we measure title width and other layout parameters in order to provide a better animation. 

What got me thinking was the last render cycle that didn't have a clear origin. After digging around I've found it is caused by a `scenes` array changing when transition finishes. What is surprising, it's just the reference to the object that changes, the content (items inside) stay the same.

I have found out that this is caused by `Transitioner` looping through an array of scenes attempting to remove stale scenes. Since scene becomes stale when you `pop` from it, this is obviously a noop when `pushing` a new route. That, obviously, causes an extra render cycle since `filter` produces same, but with a different pointer, object.

* Update Transitioner.js

* Update Transitioner.js
2018-02-20 15:44:10 -08:00
Brent Vatne
174a6e4175 Release 1.1.1 v1.1.1 2018-02-19 18:18:38 -08:00
Brent Vatne
af991e5512 Release 1.1.0 2018-02-19 18:16:23 -08:00