import {
StyleSheet,
View,
Image
} from 'react-native';
import React, {
Component
} from 'react';
const styles = StyleSheet.create({
container: {
flex: 1,
height: 100,
width: 200
},
svg: {
flex: 1,
alignSelf: 'stretch'
}
});
import Svg, {
Circle,
Rect,
Path,
Line,
G
} from 'react-native-svg';
class SvgExample extends Component{
static title = 'SVG';
render() {
return ;
}
}
class SvgOpacity extends Component{
static title = 'SVG with `opacity` prop';
render() {
return ;
}
}
class SvgViewbox extends Component{
static title = 'SVG with `viewBox="40 20 100 40" and preserveAspectRatio="none"`';
render() {
return ;
}
}
class NullComponent extends Component {
render() {
return null;
}
}
class SvgLayout extends Component{
static title = 'SVG with flex layout';
render() {
return
;
}
}
class SvgNativeMethods extends Component {
static title = 'Tap the shapes to render the Image below based on the base64-data of the Svg';
constructor() {
super(...arguments);
this.state = {
base64: null
};
}
alert = function () {
this.root.toDataURL(base64 => {
this.setState({
base64
});
});
};
render() {
return
{this.state.base64 && }
;
}
}
const icon = ;
const samples = [
SvgExample,
SvgOpacity,
SvgViewbox,
SvgLayout,
SvgNativeMethods
];
export {
icon,
samples
};