Refactor StyleSheet to support arrays

This commit is contained in:
Nicolas Gallagher
2016-02-18 16:36:02 -08:00
parent f8554ecc1e
commit 715c71b215
55 changed files with 860 additions and 869 deletions
+16 -1
View File
@@ -9,6 +9,8 @@ outside of the render loop and are applied as inline styles. Read more about to
**create**(obj: {[key: string]: any})
Each key of the object passed to `create` must define a style object.
## Example
```js
@@ -24,12 +26,25 @@ const styles = StyleSheet.create({
},
activeTitle: {
color: 'red',
},
}
})
```
Use styles:
```js
<View style={styles.container}>
<Text
style={[
styles.title,
this.props.isActive && styles.activeTitle
]}
/>
</View>
```
Or:
```js
<View style={styles.container}>
<Text