vault-development / react-native-svg-uri

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

viewBox value not supported commas #89

Open temaivanoff opened 6 years ago

temaivanoff commented 6 years ago

Hi, in some files can be sommas in the value of the view box <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="24" height="24" viewBox="0, 0, 24, 24"> and the file just does not load.

solution

  if (item.nodeName === 'viewBox') {
    return { ...item, nodeValue: item.nodeValue.replace(/\,/g, '') };
  }