We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the useTailwind must be in a component, but how could i define some styles outside the component function?
The text was updated successfully, but these errors were encountered:
I dont know what you want to do, but maybe you can pass the variable with the asignated useTailwind() as a parameter
Sorry, something went wrong.
Here is an example:
import React from 'react'; import {useTailwind} from 'tailwind-rn'; import {StyleSheet, TouchableOpacity, Text, Dimensions} from 'react-native'; export default function Card({title = '', cover = '?', isShow = false}) { const tailwind = useTailwind(); return ( <TouchableOpacity style={styles.button}> <Text style={[styles.buttonText, tailwind('text-2xl')]}> {isShow ? title : cover} </Text> </TouchableOpacity> ); } const styles = StyleSheet.create({ button: { backgroundColor: '#ccc', borderRadius: 8, width: 80, height: 80, justifyContent: 'center', alignItems: 'center', margin: (Dimensions.get('window').width - 100 * 4) / (4 * 2), }, buttonText: {}, });
How could I write tailwind in stylesheet.create but not in component?
such as on web, we can use @apply to write tailwind in css styles
Did you find a solution to this? :)
No branches or pull requests
the useTailwind must be in a component, but how could i define some styles outside the component function?
The text was updated successfully, but these errors were encountered: