Skip to content

Instantly share code, notes, and snippets.

@mdutkin
mdutkin / SVG.js
Last active July 24, 2019 07:10 — forked from beausmith/SVG.js
React Native SVG Component using react-native-svg
// React Native SVG Component
// https://github.com/react-native-community/react-native-svg
//
// Process
// 1. Clean up SVG in graphics app (Illustrator/Sketch/etc) to set consistent width, height, and make sure the viewBox is "0, 0, W, H"
// 2. Open SVG in text editor to remove width, height, and any undesired/unnecessary styles
// 3. Open in https://jakearchibald.github.io/svgomg/ and optimize.
// 4. Integrate info app by converting SVG tags to component-based SVG tags used in https://github.com/react-native-community/react-native-svg and updating with JS variables such that I can controls dimensions, colors, etc.
// You can use live converter here: https://www.smooth-code.com/open-source/svgr/playground/
// 5. Use in other components.