diff --git a/native/chat/chat-list.react.js b/native/chat/chat-list.react.js --- a/native/chat/chat-list.react.js +++ b/native/chat/chat-list.react.js @@ -75,7 +75,7 @@ componentDidMount() { const tabNavigation: ?TabNavigationProp< 'Chat', - > = this.props.navigation.dangerouslyGetParent(); + > = this.props.navigation.getParent(); invariant(tabNavigation, 'ChatNavigator should be within TabNavigator'); tabNavigation.addListener('tabPress', this.onTabPress); } @@ -83,7 +83,7 @@ componentWillUnmount() { const tabNavigation: ?TabNavigationProp< 'Chat', - > = this.props.navigation.dangerouslyGetParent(); + > = this.props.navigation.getParent(); invariant(tabNavigation, 'ChatNavigator should be within TabNavigator'); tabNavigation.removeListener('tabPress', this.onTabPress); } diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js --- a/native/chat/chat-thread-list.react.js +++ b/native/chat/chat-thread-list.react.js @@ -157,11 +157,11 @@ const chatNavigation: ?ChatNavigationProp< 'ChatThreadList', - > = this.props.navigation.dangerouslyGetParent(); + > = this.props.navigation.getParent(); invariant(chatNavigation, 'ChatNavigator should be within TabNavigator'); const tabNavigation: ?TabNavigationProp< 'Chat', - > = chatNavigation.dangerouslyGetParent(); + > = chatNavigation.getParent(); invariant(tabNavigation, 'ChatNavigator should be within TabNavigator'); tabNavigation.addListener('tabPress', this.onTabPress); @@ -173,11 +173,11 @@ const chatNavigation: ?ChatNavigationProp< 'ChatThreadList', - > = this.props.navigation.dangerouslyGetParent(); + > = this.props.navigation.getParent(); invariant(chatNavigation, 'ChatNavigator should be within TabNavigator'); const tabNavigation: ?TabNavigationProp< 'Chat', - > = chatNavigation.dangerouslyGetParent(); + > = chatNavigation.getParent(); invariant(tabNavigation, 'ChatNavigator should be within TabNavigator'); tabNavigation.removeListener('tabPress', this.onTabPress); diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js --- a/native/chat/settings/thread-settings.react.js +++ b/native/chat/settings/thread-settings.react.js @@ -1084,9 +1084,7 @@ const { navigation } = props; React.useEffect(() => { - const tabNavigation: ?TabNavigationProp< - 'Chat', - > = navigation.dangerouslyGetParent(); + const tabNavigation: ?TabNavigationProp<'Chat'> = navigation.getParent(); invariant(tabNavigation, 'ChatNavigator should be within TabNavigator'); const onTabPress = () => { diff --git a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/bottom-tabs_v5.x.x.js @@ -870,8 +870,8 @@ +goBack: () => void, +isFocused: () => boolean, +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, + +getParent: >() => ?Parent, + +getState: () => NavigationState, +addListener: |}, >>( diff --git a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/devtools_v5.x.x.js @@ -870,8 +870,8 @@ +goBack: () => void, +isFocused: () => boolean, +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, + +getParent: >() => ?Parent, + +getState: () => NavigationState, +addListener: |}, >>( diff --git a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/material-top-tabs_v5.x.x.js @@ -870,8 +870,8 @@ +goBack: () => void, +isFocused: () => boolean, +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, + +getParent: >() => ?Parent, + +getState: () => NavigationState, +addListener: |}, >>( diff --git a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js @@ -870,8 +870,8 @@ +goBack: () => void, +isFocused: () => boolean, +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, + +getParent: >() => ?Parent, + +getState: () => NavigationState, +addListener: |}, >>( diff --git a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js --- a/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js +++ b/native/flow-typed/npm/@react-navigation/stack_v5.x.x.js @@ -870,8 +870,8 @@ +goBack: () => void, +isFocused: () => boolean, +canGoBack: () => boolean, - +dangerouslyGetParent: >() => ?Parent, - +dangerouslyGetState: () => NavigationState, + +getParent: >() => ?Parent, + +getState: () => NavigationState, +addListener: |}, >>(