mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-19 13:35:11 +00:00
Refactor reuse elements
Refactor reuse elements
This commit is contained in:
@@ -7,7 +7,8 @@ import Svg, {
|
||||
Use,
|
||||
G,
|
||||
Rect,
|
||||
Circle
|
||||
Circle,
|
||||
Polyline
|
||||
} from 'react-native-art-svg';
|
||||
|
||||
class UseExample extends Component{
|
||||
@@ -42,8 +43,8 @@ class UseShapes extends Component{
|
||||
<G id="shape">
|
||||
<Rect x="0" y="0" width="50" height="50" />
|
||||
</G>
|
||||
|
||||
<Use href="#shape" x="75" y="50" fill="#0f0"/>
|
||||
<Use href="#shape" x="110" y="0" stroke="#0ff" fill="#8a3" rotation="45" origin="25, 25"/>
|
||||
<Use href="#shape" x="150" y="50" stroke="#0f0" fill="none"/>
|
||||
</Svg>;
|
||||
};
|
||||
@@ -53,7 +54,13 @@ const icon = <Svg
|
||||
height="20"
|
||||
width="20"
|
||||
>
|
||||
|
||||
<Polyline
|
||||
points="5,0 2,2 2,4 6,6 3,8 6,10 7,12 5,14 8,16 9,18"
|
||||
fill="none"
|
||||
stroke="#8a3"
|
||||
id="line"
|
||||
/>
|
||||
<Use href="#line" x="10" stroke="#3a8" />
|
||||
</Svg>;
|
||||
|
||||
const samples = [UseExample, UseShapes];
|
||||
|
||||
Reference in New Issue
Block a user