software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.51k stars 1.14k forks source link

IOS is showing black screen #2448

Open jyothine opened 2 months ago

jyothine commented 2 months ago

Description

image

Getting black screen when we don't add opacity to props <Svg height="50%" width="50%" viewBox="0 0 100 100">

If we add opacity we see white screen but no circle is displayed <Svg height="50%" width="50%" viewBox="0 0 100 100" opacity={0}>

Steps to reproduce

followed the README.md file for installation and just trying to add circle.

Snack or a link to a repository

I cannot share repo

SVG version

15.3.0

React Native version

0.74.1

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 2 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

bohdanprog commented 2 months ago

Hello @jyothine, Can you provide any example of how we can reproduce that issue?

jyothine commented 2 months ago

Sure,

project is completely native, adding small react native component in one of the module.

I am generating RCTRootView and adding subview to viewcontroller.view in IOS. It works fine when the project is completely React Native where we don't add it as subview. having issue only when we add it subview for native components project.

let reactView = RCTRootView( bridge: ReactBridgeModule.shared.createBridge(), moduleName: moduleName, initialProperties: initialProperties) self.view.addSubview(reactView ?? UIView())

if we add opacity={0.5} needsOffscreenAlphaCompositing={false}

I can see the circle

Screenshot 2024-09-13 at 3 45 52 PM