Skip to content

Handle missing react-native-safe-area-context in ScreenFooter screen#3941

Merged
M-i-k-e-l merged 2 commits intomasterfrom
fix/screen_footer_missing_safe_area_dependency
Mar 11, 2026
Merged

Handle missing react-native-safe-area-context in ScreenFooter screen#3941
M-i-k-e-l merged 2 commits intomasterfrom
fix/screen_footer_missing_safe_area_dependency

Conversation

@adids1221
Copy link
Contributor

@adids1221 adids1221 commented Feb 24, 2026

Description

Fixes crash in ScreenFooterScreen demo when react-native-safe-area-context is not installed.
Replaced the direct import with a try/catch require and added a fallback screen with install instructions.
Fixed a circular import in ScreenFooter (import {Image} from 'react-native-ui-lib'import Image from '../image') that broke the barrel export when the optional dependency was missing.

Changelog

ScreenFooterScreen - Gracefully handle missing react-native-safe-area-context dependency.

Additional info

N/A

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

✅ PR Description Validation Passed

All required sections are properly filled out:

  • Description
  • Changelog
  • Additional info

Your PR is good for review! 🚀


This validation ensures all sections from the PR template are properly filled.

Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

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

It does solve the require issue, however when the screen is selected and react-native-safe-area-context is not installed there is a red screen

@M-i-k-e-l M-i-k-e-l assigned adids1221 and unassigned M-i-k-e-l Mar 3, 2026
@adids1221 adids1221 requested a review from M-i-k-e-l March 9, 2026 12:02
@adids1221 adids1221 assigned M-i-k-e-l and unassigned adids1221 Mar 9, 2026
Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

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

The first fix (about the Image) is a good find!
However the second one is removing usages of ui-lib which seems like a bad fix even if it works.
Let's revert the second commit and merge, I might have a solution for the rest.

@M-i-k-e-l M-i-k-e-l assigned adids1221 and unassigned M-i-k-e-l Mar 10, 2026
Copy link
Contributor Author

@adids1221 adids1221 left a comment

Choose a reason for hiding this comment

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

Reverted.
The reason for using RN primitives was that uilib's View uses useSafeArea which also depends on react-native-safe-area-context, so the fallback screen would crash too. But happy to go with your solution!

adids1221

This comment was marked as duplicate.

@adids1221 adids1221 force-pushed the fix/screen_footer_missing_safe_area_dependency branch from 4b89622 to 92696b0 Compare March 11, 2026 10:23
@adids1221 adids1221 requested a review from M-i-k-e-l March 11, 2026 10:23
@adids1221 adids1221 assigned M-i-k-e-l and unassigned adids1221 Mar 11, 2026
@M-i-k-e-l M-i-k-e-l merged commit e77eb95 into master Mar 11, 2026
3 checks passed
@M-i-k-e-l M-i-k-e-l deleted the fix/screen_footer_missing_safe_area_dependency branch March 11, 2026 16:10
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.

2 participants