SVG translate not working with react-native@0.30.0 react-native-svg@4.0.0-rc
See original GitHub issueI there…
I am using react-native-svg to render charts but there seems to be problem with the svg translate attribute… as it doesn’t work.
Here is my package.json:
"react": "^15.2.0",
"react-native": "^0.29.0",
"react-native-svg": "^3.0.0"
Here is my render method:
render() {
return (
<View >
<Svg height="640" width="360">
<Circle transform="translate(200, 200)"
cx="50"
cy="50"
r="45"
stroke="blue"
strokeWidth="2.5"
fill="green"
/>
<Rect translate="rotate(45)"
x="15"
y="15"
width="70"
height="70"
stroke="red"
strokeWidth="2"
fill="yellow"
/>
</Svg>
</View>
);
}
I made sure everything is in place for react-native@0.29.0 in line with https://github.com/magicismight/react-native-svg/issues/50#issuecomment-222893637
And here is a screenshot:
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
SVG translate not working with react-native@0.30.0 ... - GitHub
I am using react-native-svg to render charts but there seems to be problem with the svg translate attribute.. as it doesn't work.
Read more >SVG transformation not working in Web Version of a React ...
The answer for that, after trying A LOT of stuff is that, theres a bug on the library on the transform property here:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this. transform prop have been fixed in 4.0.0-rc. And we have changed transform prop to something like this
I had this problem too, and using
transform={{ translate:'200, 200' }}
instead oftransform="translate(200, 200)"
fixed it 😄