Closed EyMaddis closed 4 years ago
Hey @EyMaddis , it looks like @bakerface appeared recently, so if you resolve the conflict, the PR could be merged :)
@joan-saum @bakerface Is up to date :)
@EyMaddis thank you for the pull request, this has been released to v1.0.3
I'm getting this error:
ERROR in ./node_modules/react-native-svg-web/index.js 103:13
Module parse failed: Identifier 'Svg' has already been declared (103:13)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| Svg.Stop = Stop;
|
> export const Svg = createElement("Svg", "svg");
| Svg.Svg = Svg;
|
Looks like the problem is this line was added:
Svg.Svg = Svg; // stay consistent with the old require based api
But it didn't need to be as the original author already included Svg as a named export:
Svg.Svg = createElement('Svg', 'svg');
which was changed to this in the pr:
export const Svg = createElement("Svg", "svg");
Svg.Svg = Svg;
Sorry to both of you. Should be fixed in https://github.com/bakerface/react-native-svg-web/pull/9 Since I don't actually use the library right now I did not properly test... Shame on me.
ok I'm getting a different error now:
WARNING in ./node_modules/react-native-svg-web/index.js 29:11-26
"export 'createElement' (imported as 'RNcreateElement') was not found in 'react-native-web'
This depends on the react-native-web version. In the latest the import was renamed to unstable_createElement.. Here is the way react-native-svg solves this: https://github.com/react-native-community/react-native-svg/blob/develop/src/ReactNativeSVG.web.ts#L14
Probably best to do it that way to stay backwards compatible
This aligns the project with other React-Native packages and allows to use the style behavior of React-Native-Web (
StyleSheet.create
).