Repository: software-mansion/react-native-svg (language: java)

Issue:
SVG children view with width style in percentage stopped working in 15.11.1
### Description

SVG children view that has width style in percentage dimensions stopped working in `react-native-svg@15.11.1` on both `iOS` and `Android` in the latest `react-native@0.76.6` (new arch, bridgeless mode):

https://github.com/user-attachments/assets/324f88bc-5863-4996-aa7b-755cfeacefcf

Expecting that the children view of SVG has full width of parent SVG view while width=100% style applied.
Actually the width style of children SVG view is not applied and the centered text  is hidden.

Please see reproducer (`main` branch).

---

It works fine in previous version `react-native-svg@15.10.1` (`rnsvg15.10.1` branch in reproducer repo):


https://github.com/user-attachments/assets/fbf99374-0282-4b14-bc4f-81ef9ed73f85





### Steps to reproduce

1. Open reproducer
2. Turn switch on & off that toggles style (width=100% and window.width as number) to the SVG's children view

### Snack or a link to a repository

https://github.com/zarv1k/SvgChildrenWidth100pctIssue

### SVG version

15.11.1

### React Native version

0.76.6

### Platforms

Android, iOS

### JavaScript runtime

Hermes

### Workflow

React Native

### Architecture

Fabric (New Architecture)

### Build type

Debug app & dev bundle

### Device

iOS simulator

### Device model

any iOS and Android device

### Acknowledgements

Yes


Discussion / hints:
Looks like it's similar to #2519. Tried the workaround (https://github.com/software-mansion/react-native-svg/issues/2519#issuecomment-2447509286) but it does not work.

Fix patch:
diff --git a/common/cpp/react/renderer/components/rnsvg/RNSVGLayoutableShadowNode.cpp b/common/cpp/react/renderer/components/rnsvg/RNSVGLayoutableShadowNode.cpp
index a42fde95c..d0e7498ac 100644
--- a/common/cpp/react/renderer/components/rnsvg/RNSVGLayoutableShadowNode.cpp
+++ b/common/cpp/react/renderer/components/rnsvg/RNSVGLayoutableShadowNode.cpp
@@ -8,14 +8,18 @@ RNSVGLayoutableShadowNode::RNSVGLayoutableShadowNode(
     const ShadowNodeFamily::Shared &family,
     ShadowNodeTraits traits)
     : YogaLayoutableShadowNode(fragment, family, traits) {
-  setZeroDimensions();
+  if (std::strcmp(this->getComponentName(), "RNSVGGroup") != 0) {
+    setZeroDimensions();
+  }
 }
 
 RNSVGLayoutableShadowNode::RNSVGLayoutableShadowNode(
     const ShadowNode &sourceShadowNode,
     const ShadowNodeFragment &fragment)
     : YogaLayoutableShadowNode(sourceShadowNode, fragment) {
-  setZeroDimensions();
+  if (std::strcmp(this->getComponentName(), "RNSVGGroup") != 0) {
+    setZeroDimensions();
+  }
 }
 
 void RNSVGLayoutableShadowNode::setZeroDimensions() {


Test patch: