Closed aleclarson closed 5 years ago
Looks like RCTRootViewSizeFlexibilityWidthAndHeight
was the issue. 😓
Hi @aleclarson , just had similar question about this. Could you please elaborate a bit more how you achieved it? It seems that the dimension state will not change when manually drag window's edges around. Thanks!
IIRC, the solution was to not set the sizeFlexibility
property of RCTRootContentView
to RCTRootViewSizeFlexibilityWidthAndHeight
if you want your top-level React component to fill the available space.
It seems that the dimension state will not change when manually drag window's edges around.
Are you speaking of this API specifically? I haven't tried using that yet.
@aleclarson Yes I was referring to that API. I was playing around with an existing RN project for iOS to find out which parts work well with macos and which parts don't. Apparently dimensions doesn't for now.
@unmec Okay, please open an issue for that specifically, with the expected behavior versus the actual behavior. Thanks!
Curious if anyone has tackled this before.
I've tried doing it with Javascript, to no avail. Seems like the component that I return from the
AppRegistry.registerComponent
callback must have its size manually synchronized on the native side. Is this true? Or should I be able to usewidth: '100%'
on my registeredAppRegistry
component?Note: The
contentView
of myRCTRootView
does fill the available space, but the component I return fromAppRegistry.registerComponent
doesn't want to do the same.Oh, and I'm using
RCTRootViewSizeFlexibilityWidthAndHeight
.