The value returned from style9.create
can be used as a function or as an object with properties. However, the generated code is just a plain object: the function call is transformed by the compiler to a ternary expression. To avoid issues when using the value as a function in places where babel can't track the reference, you have to explicitly make it into a plain object using the spread operator:
export const { ...styles } = style9.create({
// ...
});
Babel failed to evaluate a value used in a style definition. Try moving the value directly to the create call.
import style9 from 'style9';
import importedColor from './color';
const OBJECT = {
BLUE: 'blue'
};
const styles = style9.create({
imported: {
color: importedColor
},
object: {
color: OBJECT.BLUE
}
});
import style9 from 'style9';
const COLOR = 'blue';
const styles = style9.create({
constant: {
color: COLOR
}
});
You're using an operator or value type that isn't supported. See Usage guide for supported uses.
Look at the FAQ, search the repo, or ask in discussions.