Commit Graph

1650 Commits

Author SHA1 Message Date
Satyajit Sahoo
78560d858f chore: publish
- @react-navigation/bottom-tabs@6.0.3
 - @react-navigation/drawer@6.1.1
 - @react-navigation/elements@1.0.3
 - @react-navigation/material-bottom-tabs@6.0.3
 - @react-navigation/native-stack@6.0.4
 - @react-navigation/stack@6.0.4
2021-08-10 01:49:49 +02:00
Satyajit Sahoo
bacdbbdd7c fix: avoid overflowing long titles 2021-08-10 01:48:32 +02:00
Satyajit Sahoo
9613cbe680 refactor: add description to headerTitle and headerLeft 2021-08-10 00:40:04 +02:00
Vojtech Novak
a79ce57aa7 fix: pass onlayout to headerTitle (#9808)
similar to https://github.com/react-navigation/react-navigation/pull/9806 but for headerTitle's onlayout prop
2021-08-10 00:26:12 +02:00
Vojtech Novak
22799fc96e fix: pass all props to custom headerLeft (#9806)
closes #9805
2021-08-10 00:25:42 +02:00
Satyajit Sahoo
b0130570be chore: publish
- @react-navigation/stack@6.0.3
2021-08-09 10:22:54 +02:00
Satyajit Sahoo
4d8a7ee7e4 fix: consider all next headers instead of immediate next
fixes #9797
2021-08-09 10:17:37 +02:00
Satyajit Sahoo
d17bf146ee chore: publish
- @react-navigation/bottom-tabs@6.0.2
 - @react-navigation/drawer@6.1.0
 - @react-navigation/elements@1.0.2
 - @react-navigation/material-bottom-tabs@6.0.2
 - @react-navigation/material-top-tabs@6.0.2
 - @react-navigation/native-stack@6.0.3
 - @react-navigation/native@6.0.2
 - @react-navigation/stack@6.0.2
2021-08-07 15:15:18 +02:00
Kazuaki Horita
ebb5f24664 feat: use forwardRef with DrawerContentScrollView (#9695)
Closes #9350
2021-08-07 15:12:06 +02:00
Satyajit Sahoo
40dcbcf2fa fix: avoid blink when switching tab screens 2021-08-07 15:05:55 +02:00
Satyajit Sahoo
0f5868f64d refactor: consolidate modal checks 2021-08-07 15:03:37 +02:00
Alexander
99735e1b73 fix: blink while switching screens (#9705)
Fix to prevent showing blank screen while screens switching process.
Currently we can see it using dark background color in screens.
This fix also makes clear work with eager loading of screens (`detachInactiveScreens={false}` `lazy={false}`).
2021-08-07 15:03:16 +02:00
Giannis Macheras
dfd0cc78fe fix: fix crash in useLinkTo when passing an object (#9800)
When an object was passed to the `to` parameter in `useLinkTo`, an error message would be thrown (Cannot find property 'root'). Apparently, this was introduced in commit 1d40279, where the `root` variable was removed.
2021-08-07 13:34:03 +02:00
Satyajit Sahoo
3aab9fd05e chore: update issue template config 2021-08-05 18:32:16 +02:00
Satyajit Sahoo
d6a3ca5967 chore: publish
- @react-navigation/native-stack@6.0.2
2021-08-05 18:25:00 +02:00
Satyajit Sahoo
1da575e0e7 fix: fix incorrect name for headerTransparent 2021-08-05 18:21:15 +02:00
Satyajit Sahoo
e299167e10 chore: publish
- @react-navigation/bottom-tabs@6.0.1
 - @react-navigation/core@6.0.1
 - @react-navigation/devtools@6.0.1
 - @react-navigation/drawer@6.0.1
 - @react-navigation/elements@1.0.1
 - flipper-plugin-react-navigation@1.3.4
 - @react-navigation/material-bottom-tabs@6.0.1
 - @react-navigation/material-top-tabs@6.0.1
 - @react-navigation/native-stack@6.0.1
 - @react-navigation/native@6.0.1
 - @react-navigation/routers@6.0.1
 - @react-navigation/stack@6.0.1
2021-08-03 11:37:45 +02:00
Satyajit Sahoo
80867722c5 Revert "fix: don't merge initial params when merge !== true"
This reverts commit 54b215b9d3.
2021-08-03 11:36:37 +02:00
Satyajit Sahoo
98fa233014 fix: preserve params when switching tabs. fixes #9782 2021-08-03 11:35:19 +02:00
Zhigang Fang
be8532c086 fix: add merge to the navigate types (#9777) 2021-08-03 11:24:17 +02:00
Ethan Neff
8f4daef5b3 docs: update docs to react navigation 6 (#9779) 2021-08-03 11:21:32 +02:00
Satyajit Sahoo
2084fb859f chore: publish
- @react-navigation/bottom-tabs@6.0.0
 - @react-navigation/core@6.0.0
 - @react-navigation/devtools@6.0.0
 - @react-navigation/drawer@6.0.0
 - @react-navigation/elements@1.0.0
 - flipper-plugin-react-navigation@1.3.3
 - @react-navigation/material-bottom-tabs@6.0.0
 - @react-navigation/material-top-tabs@6.0.0
 - @react-navigation/native-stack@6.0.0
 - @react-navigation/native@6.0.0
 - @react-navigation/routers@6.0.0
 - @react-navigation/stack@6.0.0
2021-08-02 00:53:11 +02:00
Satyajit Sahoo
3ce4276a39 chore: prepare for stable release of 6.x 2021-08-02 00:49:38 +02:00
Satyajit Sahoo
1a39632656 feat: add custom header option to native-stack 2021-08-01 16:30:07 +02:00
Wojciech Lewicki
20abccda0d feat: expose header height in native-stack (#9774) 2021-08-01 16:04:25 +02:00
Satyajit Sahoo
de84458960 feat: basic web implementation for native stack 2021-08-01 15:30:36 +02:00
Satyajit Sahoo
73277d533c chore: upgrade react-native-tab-view 2021-07-31 03:04:58 +02:00
Satyajit Sahoo
8a95fb588b fix: remove dep on react-native-iphonex-helper 2021-07-31 01:25:15 +02:00
Satyajit Sahoo
6d518a46b8 fix: show error when beforeRemove is used to prevent action in naive stack 2021-07-28 15:31:27 +02:00
Satyajit Sahoo
d2d7f8d95e fix: clear options set from a screen when it unmounts. closes #9756 2021-07-28 14:47:09 +02:00
Satyajit Sahoo
51b636d726 fix: match native iOS header height in stack 2021-07-28 14:12:43 +02:00
Satyajit Sahoo
9506ad1f00 fix: add deprecation warning for openByDefault 2021-07-28 12:56:08 +02:00
Satyajit Sahoo
5bfc39668b feat: move some props to screenOptions in material top tabs 2021-07-28 12:49:28 +02:00
Satyajit Sahoo
fdb3ede3e0 feat: add tabBarBadge and tabBarIndicator options for material top tabs 2021-07-28 11:58:34 +02:00
Satyajit Sahoo
504b26f3ae chore: add documentation links in deprecation messages 2021-07-27 13:00:23 +02:00
Satyajit Sahoo
5f4e124032 fix: remove tabBarAdapative option 2021-07-26 15:12:36 +02:00
Satyajit Sahoo
54b215b9d3 fix: don't merge initial params when merge !== true 2021-07-26 13:35:54 +02:00
Satyajit Sahoo
9b2105692d chore: fix regex for snack 2021-07-21 02:31:16 +02:00
Satyajit Sahoo
3e2155b929 chore: change expo.io to expo.dev 2021-07-21 00:43:50 +02:00
Satyajit Sahoo
c322b0501c feat: add a way to filter out deep links from being handled
This is useful for libraries like `expo-auth-session` which also use links for authentication.

Usage:

```js
const linking = {
  prefixes: ['myapp://'],
  filter: (url) => !url.includes('+expo-auth-session'),
};
```
2021-07-20 18:57:41 +02:00
Satyajit Sahoo
e3c514d684 chore: publish
- @react-navigation/devtools@6.0.0-next.19
2021-07-19 22:22:34 +02:00
Satyajit Sahoo
f666059d80 fix: ignore errors from symbolication in devtools 2021-07-19 22:17:51 +02:00
Satyajit Sahoo
42a875212c chore: publish
- @react-navigation/bottom-tabs@6.0.0-next.22
 - @react-navigation/core@6.0.0-next.17
 - @react-navigation/devtools@6.0.0-next.18
 - @react-navigation/drawer@6.0.0-next.21
 - @react-navigation/elements@1.0.0-next.21
 - flipper-plugin-react-navigation@1.3.2
 - @react-navigation/material-bottom-tabs@6.0.0-next.18
 - @react-navigation/material-top-tabs@6.0.0-next.18
 - @react-navigation/native-stack@6.0.0-next.11
 - @react-navigation/native@6.0.0-next.17
 - @react-navigation/stack@6.0.0-next.29
2021-07-16 11:50:08 +02:00
Satyajit Sahoo
577d79e98c fix: use nested params for initial state only
This fixes an issue where the new actions could bring back the params even after it was reset
2021-07-16 11:48:53 +02:00
Satyajit Sahoo
858d256b0a chore: publish
- @react-navigation/bottom-tabs@6.0.0-next.21
 - @react-navigation/core@6.0.0-next.16
 - @react-navigation/devtools@6.0.0-next.17
 - @react-navigation/drawer@6.0.0-next.20
 - @react-navigation/elements@1.0.0-next.20
 - flipper-plugin-react-navigation@1.3.1
 - @react-navigation/material-bottom-tabs@6.0.0-next.17
 - @react-navigation/material-top-tabs@6.0.0-next.17
 - @react-navigation/native-stack@6.0.0-next.10
 - @react-navigation/native@6.0.0-next.16
 - @react-navigation/stack@6.0.0-next.28
2021-07-16 10:30:13 +02:00
Satyajit Sahoo
c333f4086e fix: fix devtools not sending new events if an error occured 2021-07-16 10:29:59 +02:00
DrRefactor
16f0e11822 fix: prevent navigation state updates after state cleanup (#9688)
Problem:
When using nested navigators, unmounts cause race cleanup races.

Imagine following hierarchy (from tree root downwards, parent to children):
TabNavigator (1) [renders useNavigationBuilder]
  SceneView (from TabNavigator)
StackNavigators (N) [each renders useNavigationBuilder] 
  SceneView (from StackNavigator)

Now lets test following flow:
1. Mount above navigators with given navigation params (e.g. navigation for unauthenticated users) 
2. Unmount all navigators (e.g. during login process)
3. Mount above navigation with different navigation params than in 1) (e.g. navigation for authenticated users)

What you'll observe, there will be old navigation params preserved in 3) coming from 1).

Source of problem:
BaseNavigationContainer holds global navigation state, exposes API to modify it via NavigationStateContext. When useNavigationBuilder unmounts, it attempts to clear navigation state. (see cleanup effect in useNavigationBuilder.tsx).

(I) First clear occurs in TabNavigator's effect, which successfully clears BaseNavigationContainer's state (sets it to undefined).

(II) Second clear comes from StackNavigator unmount. It's useNavigationBuilder cleanup effect also calls NavigationStateContext.setState(undefined).
But this time - we meet SceneView as closest NavigationStateContext.Provider. SceneView attempts to merge state change with current navigation state, which is reasonable. But current navigation state should be already undefined... It is, but:
```
[useNavigationBuilder.tsx]

const getState = React.useCallback((): State => {
    const currentState = getCurrentState();

    return isStateInitialized(currentState)
      ? (currentState as State)
      : (initializedStateRef.current as State);
  }, [getCurrentState, isStateInitialized]);
```
"undefined" state is treated is non-initialized state, and freshly computed state (initializedStateRef.current) is returned instead.
SceneView does merge this old state with `undefined` value, and passes to BaseNavigationContainer. Now we have some legacy global state, despite all navigators being unmounted.

After mounting navigators again (3), we can observe old params being restored. These params might come e.g. from old `initialParams` prop (from 1)).

Solution:
Do not propagate `setState` upwards in `useNavigationBuilder` after state cleanup. This way we'll omit such races.
2021-07-16 10:29:26 +02:00
Michael Ru
ee12690a82 fix: update isClosing in stack card (#9738)
I noticed that accessing `closing` through `cardStyleInterpolator` would always return an Animated node with value 0. It looks like it isn't being updated anywhere, so I added it to the `animate` method.

I am using this functionality to allow screens to have different in and out transitions.

On a side note, I feel like this would be more useful as a boolean, instead of an Animated value.

Co-authored-by: Michael Ru <michaelru@abridge.com>
2021-07-16 10:25:51 +02:00
Zhigang Fang
4135d09c6f fix: sort wildcard and :params (#9672) 2021-07-01 13:28:46 +02:00
Satyajit Sahoo
a70adfbca1 chore: publish
- @react-navigation/bottom-tabs@6.0.0-next.20
 - @react-navigation/core@6.0.0-next.15
 - @react-navigation/devtools@6.0.0-next.16
 - @react-navigation/drawer@6.0.0-next.19
 - @react-navigation/elements@1.0.0-next.19
 - flipper-plugin-react-navigation@1.3.0
 - @react-navigation/material-bottom-tabs@6.0.0-next.16
 - @react-navigation/material-top-tabs@6.0.0-next.16
 - @react-navigation/native-stack@6.0.0-next.9
 - @react-navigation/native@6.0.0-next.15
 - @react-navigation/routers@6.0.0-next.6
 - @react-navigation/stack@6.0.0-next.27
2021-07-01 03:08:40 +02:00