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
I have dumb component, and for getting access to colors I must use EStyleSheet.value.
const DumbComponent = () => { const [isActive, setActive] = useState(false); //Current realisation const activeBackground = EStyleSheet.value('$red'); const disabledBackground = EStyleSheet.value('$blue'); return ( <BumbElement color={isActive ? activeBackground : disabledBackground} /> ); };
But can we put inside EStyleSheet.create custom object with colors what we need, and after use it in our component?
EStyleSheet.create
const styles = EStyleSheet.create({ colors: { red: '$red', blue: '$blue', }, contentContainerStyle: { flexDirection:'row' } }); const DumbComponent = () => { const [isActive, setActive] = useState(false); return <BumbElement color={styles.colors[isActive ? 'red' : 'blue']} />; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have dumb component, and for getting access to colors I must use EStyleSheet.value.
But can we put inside
EStyleSheet.create
custom object with colors what we need, and after use it in our component?The text was updated successfully, but these errors were encountered: