0.0.7 • Published 8 days ago
@touchblack/ui v0.0.7
Usage
add this import statement in your App.tsx, it's used to initialise react-native-unistyles which is a dependency of this package
import '@touchblack/ui/init'
Now you can import any component and use it anywhere in your app.
Note
you don't need to initialise unistyles again in your app. Ya can just use it as you've already initialised it by the adding the import statement above. example:
import React from 'react';
import '@touchblack/ui/init';
import { View, Text } from 'react-native'
import { Button } from '@touchblack/ui';
import { createStyleSheet, useStyles } from 'react-native-unistyles'
const stylesheet = createStyleSheet(theme => ({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: theme.colors.black
},
text: {
color: theme.colors.primary
}
}))
const App = () => {
const { styles } = useStyles(stylesheet)
return (
<View style={styles.container}>
<Text style={styles.text}>
Unistyles example
</Text>
<Button textColor='primary' onPress={() => console.log("Clicked")}>Hellow</Button>
</View>
)
}
export default App