Skip to content

fix: fix js bottom tabs crashing on contacts in example#545

Open
chitrakshtarun wants to merge 1 commit into
callstack:mainfrom
chitrakshtarun:main
Open

fix: fix js bottom tabs crashing on contacts in example#545
chitrakshtarun wants to merge 1 commit into
callstack:mainfrom
chitrakshtarun:main

Conversation

@chitrakshtarun

Copy link
Copy Markdown

PR Description

Bug fix.

Fixes the runtime crash in the JS Bottom Tabs example when switching to the Contacts tab:

Couldn't find the bottom tab bar height. Are you inside a screen in Native Bottom Tab Navigator?

Root cause: The Contacts.tsx screen is shared by all example navigators, and was using the useBottomTabBarHeight import. This threw because of a missing context in the JS implementation, as it used the JS implementation instead of the Native Implementation.

This fix should read from the context safely, and fallback to a nullish coalescence value to prevent any errors.

How to test?

  • Run the example app.
  • Scroll down to the JS Tabs examples.
  • Navigate to the Contacts tabs.
  • Contacts tabs should now render as intended and not throw an error.

Screenshots

js-bottom-tabs-repro.mov

Closes #533

@chitrakshtarun

Copy link
Copy Markdown
Author

Hi @thiagobrez, hope pinging for this is fine!

This is my first PR in the repo, have made my best attempts to ensure the CONTRIBUTING.md guidelines are met. yarn typecheck and yarn lint return no errors.

Please let me know if the same looks fine, or if I should do any further changes before the PR is merged.

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.

JS Bottom Tabs examples crashing on Contacts tab

1 participant