Skip to content

Conversation

@du5rte
Copy link

@du5rte du5rte commented May 26, 2020

Added svgs to support both react and react-native.

The svgs module is compatibility layer between react-native-svg and regular react (browser) based SVG elements. This allows you to write SVG in the react and react-native using exactly the same API. Bringing your applications a step closer to writing fully isomorphic application.

Screenshot 2020-05-26 at 22 16 41

fixes:

Stays the same for users

Nothing changes in how users use the library. Behind the scenes svgs detects if the environment is run for web or native.

How svgs works

On web, most components are just renamed to conform with react-native-svg exports, here:

function ClipPath(props) {
  return <clipPath { ...prepare(props) } />;
}

on native, it exports react-native-svg, here:

import RNSvg, {
  ClipPath,
  ...
} from 'react-native-svg';

export {
  ClipPath,
  ...
};

export default Svg;

@rafaelbpa
Copy link

This is working perfectly on react-native. Can someone review and merge? Thank you btw, saved my day.

@dunklesToast
Copy link

How's the state of this getting merged?

@kkelley-leftbrain
Copy link

Just stumbled across this, sounds promising - any update on the merge conflict in package.json?

@FDiskas
Copy link

FDiskas commented Jun 22, 2021

time goes fast - do it 🗡️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants