⚛️ A Utility-First Styling Library for React Native
support static expressions as arguments (79ab202)
We are now using babel-helper-evaluate-path
(the same package used by plugins like babel-plugin-minify-constant-folding
) to statically
evaluate the first argument passed to styled
. That means it's now possible to write something like this:
const bgWhite = 'bg-white'
const style = [bgWhite, 'text-black']
styled(style)
Template literals and other simple expressions also work.
Please note that object properties still don't work e.g.
const styles = {
text: ['text-base']
}
styled(styles.text) // will throw an error