react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

chore: Add doc explaining the current state of FormSheets layout on android & ios

Open t0maboro opened this issue 3 weeks ago • 0 comments

Description

Follow-up for: https://github.com/software-mansion/react-native-screens/pull/3454 I decided to create a completely new doc because it's longer than I expected initially. Idk if this placement is okay, feel free to leave some suggestions on how we'd like to expose it.

(Putting the following information inside the doc doesn't make sense to me, because it may change, so I cannot guarantee the correctness of the information below for the future) I checked other libraries how they handle flex:1 on iOS inside BottomSheet's content:

  • https://github.com/ammarahm-ed/react-native-actions-sheet - flex works fine, but it's JS-only implementation based on Reanimated and Gesture Handler, it's unrelated with sheet detents concept
  • https://github.com/lodev09/react-native-true-sheet - flex doesn't work, similarly to Screens, there are Container (equivalent of our Screen component) and Content (our ScreenContentWrapper match) components, flex cannot expand Content to the Container's size
  • https://github.com/expo/expo/tree/main/packages/expo-ui - flex doesn't work

For all above, I was testing whether the following example is working

<BottomSheet {...props}>
  <View style={{flex: 1, backgroundColor: 'red'}} />
</BottomSheet>

Therefore, as for now, we have 2 options:

  • do not support flex on iOS (it's working fine on Android in RNScreens)
  • support flex with inconsistent layout between Android and iOS, allowing developers to style both components with flex, but with provided guidance from us, what outcome may they expect on which platform - this PR aims to describe these inconsistencies

For the future, we'll have a 3rd option: when the iOS 15 support will be dropped (we're dependent on the core RN team here; we're not aware of any timelines when this may happen), there's a chance that iOS implementation could be aligned with Android approach.

t0maboro avatar Dec 08 '25 16:12 t0maboro