flatten: CallExpression
Flattens an array of style objects, into one aggregated style object. Alternatively, this method can be used to lookup IDs, returned by StyleSheet.register.
NOTE: Exercise caution as abusing this can tax you in terms of optimizations.
IDs enable optimizations through the bridge and memory in general. Refering to style objects directly will deprive you of these optimizations.
Example:
var styles = StyleSheet.create({
listItem: {
flex: 1,
fontSize: 16,
co