Closed cerven closed 2 years ago
Would you have more information on the crash (version of React Native, if you are using Expo, version of Expo, version of react-native-svg, maybe logs)? I can create a simple fix, but I would like to know the root cause of this bug first.
I am unable to reproduce this error. It seems related to this https://github.com/react-native-svg/react-native-svg/issues/987 and https://github.com/react-native-svg/react-native-svg/issues/901.
App will not crash, you are right, it is related to react-native-svg. If I run it in expo, it is ok, but if i run it in custom build of expo(expo run:ios), or from xcode as native app, it will print this warning/error.
<Svg height={100} width={100}>
<Path d='' stroke='black' strokeLinejoin="round" />
</Svg>
attributes "d", "stroke" and "strokeLinejoin" are required for this to happen("d" has to be empty string).
It means in react-native-draw this will happen as I described above. It is not bug in this package.
Ok makes sense, I'll still merge the PR to remove that error/log for those who are using old versions
The fix for older versions of react-native-svg
is now available in version 0.5.0
:tada:
I am showing react-native-draw with predefined paths.
In react native console it always log message "Error [CoreGraphics] clip: empty path.".
It looks like this error is because SVGRenderer it rendering "memoized"(currentPath) path even when it does not exists(is empty): https://github.com/BenJeau/react-native-draw/blob/master/src/components/renderer/SVGRenderer.tsx#L49