[add] StyleSheet.compose

As per the recent addition to React Native.
This commit is contained in:
Nicolas Gallagher
2017-12-20 11:27:55 +00:00
parent ed1e45a43d
commit 1a20fcfce6
4 changed files with 37 additions and 2 deletions

View File

@@ -21,6 +21,22 @@ const StyleSheetScreen = () => (
</Description>
<Section title="Methods">
<DocItem
description={
<AppText>
Combines two styles such that <Code>style2</Code> will override any styles in{' '}
<Code>style1</Code>. If either style is falsy, the other one is returned without
allocating an array, saving allocations and maintaining reference equality for{' '}
<Code>PureComponent</Code> checks.
</AppText>
}
example={{
code: 'StyleSheet.compose(style1, style2);'
}}
name="compose"
typeInfo="(style1, style2) => style"
/>
<DocItem
description="Each key of the object passed to `create` must define a style object. The returned object replaces style objects with IDs"
example={{