Fix fabric layout issues in iOS on fresh React Native v0.80.0 #731
Fix fabric layout issues in iOS on fresh React Native v0.80.0 #731scarlac merged 1 commit intoteslamotors:masterfrom
Conversation
|
I got the blank issue on iOS and this pr fixes it :success: |
|
works perfectly, thank you very much! should be merged asap. |
|
Had the same issue, this fixes it! |
|
Excellent work @SmartArray - I confirmed that it fixes it on iOS with new arch enabled. Thank you for the contribution |
|
Hey @scarlac did you setup a new release with this correction? I will be applying it as patch but a update with this fix would be awesome. |
|
Hey @RRigueira24 I found out that the issue goes way deeper. We aren't actually using the new arch, so it "sorta works" but we are not fully opted in. It's officially enabled, but when you run it, it does not use Fabric, which means we are only half ported (New arch is Fabric view components (the camera view finder) + JSI modules (the API you call .capture() on)). |
|
A fix should have been included with v16.0.0: |

Summary
Add constraints for all subviews
Motiviation
We at DigiCorp Labs are using this awesome camera library in our enterprise apps for code scanning.
During the update of one of our apps to React Native 0.80.0 the screen disappeared. It took us a while to figure out what was going on, but it seems that the new fabric renderer doesn't set the correct constraints and the developer has to handle this now, otherwise we get a white screen just as described in the issue: #708. Note that this is definitely not a permission issue; we tested this a couple of times. The view simply doesn't have a layout set.
What we changed in this PR
Introduced a helper that embeds each subview with full-height-and-width constraints:
https://github.com/SmartArray/react-native-camera-kit/blob/c70b91e38599799b574af5a0fca7967aee99b22c/ios/ReactNativeCameraKit/CameraView.swift#L98-105
Applied this helper to camera preview, overlay, focus, and scanner views.
Why It Was Required
How did you test this change?
Further testing