vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
850 stars 334 forks source link

Not Compatible with JSX #205

Open I2obiN opened 3 years ago

I2obiN commented 3 years ago

Getting this error on npm install. Just putting this here for people getting the same error. Can't see any way to resolve this from my side.

SyntaxError: C:\Users\thhood\Projects\------\ui.frontend\node_modules\react-native-svg-uri\index.js: Support for the experimental syntax 'jsx' isn't currently enabled (168:14):

  166 |       }
  167 | 
> 168 |       return <Svg key={i} {...componentAtts}>{childs}</Svg>;
      |              ^
  169 |     case 'g':
  170 |       componentAtts = this.obtainComponentAtts(node, G_ATTS);
  171 |       return <G key={i} {...componentAtts}>{childs}</G>;

Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.