-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
19 lines (17 loc) · 667 Bytes
/
Copy pathapp.js
File metadata and controls
19 lines (17 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from 'react';
import { View, TouchableOpacity } from 'react-native';
import PolymorphicComponent from './components/PolymorphicComponent';
const App = () => (
<View>
<PolymorphicComponent as="h1" style={{ color: 'red' }}>
This is a heading (h1)
</PolymorphicComponent>
<PolymorphicComponent style={{ color: 'black' }}>
This is a text
</PolymorphicComponent>
<PolymorphicComponent as={TouchableOpacity} style={{ backgroundColor: 'blue', color: 'white' }} onPress={() => alert('Button pressed!')}>
Press Me
</PolymorphicComponent>
</View>
);
export default App;