software-mansion / react-native-svg

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

The Use component linked to Symbol not showing anything without width and height properties #1432

Open kaelite opened 4 years ago

kaelite commented 4 years ago

Bug

The Use component linked to Symbol component is not showing anything without width and height properties

Screen of the Symbol example from the documentation with three elements, but showing only two (no element without width an height props): image

Expected to have all three: image

Environment info

Reproduced on various versions of iOS

System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 639.10 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.2 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
    Python: 2.7.17 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ~16.11.0 => 16.11.0
    react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 12.1.0

Steps To Reproduce

Empty expo project with the code below

Example

The part of the code is from documentation:

<Svg height="150" width="110">
  <Symbol id="symbol" viewBox="0 0 150 110" width="100" height="50">
    <Circle cx="50" cy="50" r="40" strokeWidth="8" stroke="red" fill="red" />
    <Circle
      cx="90"
      cy="60"
      r="40"
      strokeWidth="8"
      stroke="green"
      fill="white"
    />
  </Symbol>

  <Use href="#symbol" x="0" y="0" /> {/* Problem here */}
  <Use href="#symbol" x="0" y="50" width="75" height="38" />
  <Use href="#symbol" x="0" y="100" width="50" height="25" />
</Svg>

PS: Thanks for your great job!!!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

harveyconnor commented 3 years ago

Yep same issue here. I think this repo is dead, nobody is maintaining it...

candiii-lin commented 3 years ago

Reproduce this issue again, is anyone planning to fix this?

alex-kachkin commented 1 year ago

still reproducing, has someone solved the problem?

kaelite commented 1 year ago

Problem still reproduced on "react-native-svg": "13.4.0", expo sdk 48.0.0

bohdanprog commented 2 months ago

Hello @kaelite, I believe that no element in react-native-svg displays without specifying width and height. Could I be overlooking something?

kaelite commented 2 months ago

Hello @kaelite, I believe that no element in react-native-svg displays without specifying width and height. Could I be overlooking something?

I don't really understand the question. There was an example from official documentation that was not working (currently this example in USAGE.md -> Symbol). Width and height parameters defined in Symbol element, expecting to use those when use without width and height. I believe that it was working before due to example provided. Thanks

PS: Just checked: it doesn't work in 15.1.0