Skip to content

Commit

Permalink
Add example code in SampleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
SjaakSchilperoort committed Apr 1, 2022
1 parent f855178 commit 4a71167
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions TestsExample/src/SampleTest.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import { PlatformColor, Platform, Button } from 'react-native';
import { Platform, Button, SafeAreaView } from 'react-native';
import {
Svg,
Circle,
Rect,
Text,
TSpan
TSpan,
SvgCssUri
} from 'react-native-svg';

const color = PlatformColor(Platform.select({
Expand All @@ -16,6 +17,7 @@ const color = PlatformColor(Platform.select({

export default () => {
const [test, setTest] = React.useState(50);
const [uri, setUri] = React.useState('https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/not_existing.svg')

return (
<>
Expand Down Expand Up @@ -44,6 +46,12 @@ export default () => {
</Text>
</Svg>
<Button title="Click me" onPress={()=> setTest(test + 1)}/>
<SvgCssUri
onError={() => setUri('https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/ruby.svg')}
width="100"
height="100"
uri={uri}
/>
</>
);
}

0 comments on commit 4a71167

Please sign in to comment.