Skip to content

Commit

Permalink
Merge fb70c99 into 040e200
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmg94 committed Jan 19, 2020
2 parents 040e200 + fb70c99 commit e92bf20
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export {
TSpan,
Text,
TextPath,
Use
Use,
SvgUri,
SvgCssUri
} from "react-native-svg";

// Export SVG object with enhanced props which includes the title
Expand Down
26 changes: 25 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,28 @@ function Pattern(props) {
return <pattern { ...prepare(props) } />;
}

/**
* Return an SVG element from Uri.
*
* @param {Object} props The properties that are spread on the SVG element.
* @returns {React.Component} Use SVG.
* @public
*/
function SvgUri({ uri, ...props }) {
return <img src={uri} { ...prepare(props) } />;
}

/**
* Return an SVG element from Uri.
*
* @param {Object} props The properties that are spread on the SVG element.
* @returns {React.Component} Use SVG.
* @public
*/
function SvgCssUri({ uri, ...props }) {
return <img src={uri} { ...prepare(props) } />;
}

//
// Expose everything in the same way as `react-native-svg` is doing.
//
Expand All @@ -429,7 +451,9 @@ export {
TSpan,
Text,
TextPath,
Use
Use,
SvgUri,
SvgCssUri
};

export default Svg;
4 changes: 3 additions & 1 deletion index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import RNSvg, {
TSpan,
Text,
TextPath,
Use
Use,
SvgUri,
SvgCssUri,
} from 'react-native-svg';

/**
Expand Down

0 comments on commit e92bf20

Please sign in to comment.