Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: useSelectedTab broken behaviour #10421

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

MounirDhahri
Copy link
Member

@MounirDhahri MounirDhahri commented Jun 21, 2024

Description

This PR comes as a follow-up on #10415

Screen.Recording.2024-06-21.at.14.33.51.mov

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@MounirDhahri MounirDhahri self-assigned this Jun 21, 2024
@MounirDhahri MounirDhahri marked this pull request as ready for review June 21, 2024 12:35
import { __unsafe_mainModalStackRef } from "app/NativeModules/ARScreenPresenterModule"
import { BottomTabType } from "app/Scenes/BottomTabs/BottomTabType"

export function useSelectedTab(): BottomTabType {
const tabState = __unsafe_mainModalStackRef.current
const tabState = useNavigationState(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call returns the tab stack routes when called from within a nested screen in a tab and therefore tabState will be equal to undefined. It works fine though sometimes 🤷 - I am avoiding the issue now by using a combination of both.

@ArtsyOpenSource
Copy link
Contributor

Warnings
⚠️

An error occurred while validating your changelog, please make sure you provided a valid changelog.

Generated by 🚫 dangerJS against 2ff8236

@MounirDhahri MounirDhahri merged commit c1fd2cf into main Jun 21, 2024
8 checks passed
@MounirDhahri MounirDhahri deleted the fix/use-selected-tab branch June 21, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants