File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
packages/create-react-native-library/templates/common-example/example/src Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
3
- < % if ( project . view ) { - % >
3
+ < % if ( project . view && project . module ) { - % >
4
+ import { StyleSheet , View , Text } from 'react-native' ;
5
+ import { < % - project . name - % > View , multiply } from '<%- project.slug -%>' ;
6
+ < % } else if ( project . view ) { - % >
4
7
import { StyleSheet , View } from 'react-native' ;
5
8
import { < % - project . name - % > View } from '<%- project.slug -%>' ;
6
9
< % } else { - % >
7
10
import { StyleSheet , View , Text } from 'react-native' ;
8
11
import { multiply } from '<%- project.slug -%>' ;
9
12
< % } - % >
10
13
11
- < % if ( project . view ) { - % >
14
+ < % if ( project . view && project . module ) { - % >
15
+ export default function App ( ) {
16
+ const [ result , setResult ] = React . useState < number | undefined > ( ) ;
17
+
18
+ React . useEffect ( ( ) => {
19
+ multiply ( 3 , 7 ) . then ( setResult ) ;
20
+ } , [ ] ) ;
21
+
22
+ return (
23
+ < View style = { styles . container } >
24
+ < Text > Result: { result } </ Text >
25
+ < < % - project . name - % > View color="#32a852" style={ styles . box } />
26
+ </ View >
27
+ );
28
+ }
29
+ < % } else if ( project . view ) { - % >
12
30
export default function App() {
13
31
return (
14
32
< View style = { styles . container } >
You can’t perform that action at this time.
0 commit comments