mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 05:55:10 +00:00
Support G inherit props. Refactor text render. Text glyphs will perfectly draw along the path
27 lines
604 B
JavaScript
27 lines
604 B
JavaScript
import React, {Component, PropTypes} from 'react';
|
|
|
|
import ViewBox from './ViewBox';
|
|
import G from './G';
|
|
|
|
class SymbolElement extends Component{
|
|
static displayName = 'Symbol';
|
|
static propType = {
|
|
id: PropTypes.string.isRequired
|
|
};
|
|
render() {
|
|
let {props} = this;
|
|
|
|
return <G id={props.id}>
|
|
<ViewBox
|
|
{...props}
|
|
viewbox={props.viewbox}
|
|
preserveAspectRatio={props.preserveAspectRatio}
|
|
>
|
|
{props.children}
|
|
</ViewBox>
|
|
</G>;
|
|
}
|
|
}
|
|
|
|
export default SymbolElement;
|