0

I am trying to use @react-navigation/native-stack and presentation: 'modal' to get more native feel on tablets. My problem is I did not find any way how to get dimensions of modal window. I tried both useWindowDimensions() and Dimensions.get('window/screen') but I always get size of whole app window, not just the modal window size.

Is there any way how to do that?

Illustration

alesdvorak.cz
  • 133
  • 1
  • 10

1 Answers1

2

if u cant find something u can always use "onLayout", juts put t on wrapper View in modal

<View style={{flex:1}} onLayout={(event: LayoutChangeEvent) => {
  // event.nativeEvent.layout.width
  // event.nativeEvent.layout.height
}}>
</View>
Engazan
  • 470
  • 1
  • 3
  • 16