Use a single codebase to render svg on Sketch, Web and React Native, but react-primitives
doesn't support svg yet. One suggestion is to use react-primitives-svg
, but there's an issue when trying to render it on the web, as described in airbnb/react-sketchapp#265.
We could directly use the core.web.js
file as below. Also there might be a way to pick up the .web.js
extension just as .android.js
and .ios.js
.
// Svg.js
import { Platform } from "react-primitives";