James Isaac 820cfa1f3b Refine StyleSheet Flow types
Summary:
Nice addition of the recent Flow types for style props in 9c29ee1504a66979d7e87f60e42d437e044a1ada, however I think there are some slight issues in the definition.

`type Styles = {[key: string]: Object}` makes sense, as it's referring to the set of named style groups a user creates a `StyleSheet` from, e.g.

```javascript
const styles: StyleSheet = StyleSheet.create({
  container: {
    height: 20
  },
  text: {
    color: '#999',
    fontSize: 12,
  },
}: Styles)
```

However `type StyleValue = {[key: string]: Object}` doesn't make sense.  You actually want only the `Object` portion of that definition, presuming it's meant to be used like below:

```javascript
type MyTextProps = {
  style: StyleProp,
}

<MyText style={{ color: '#999', fontSize: 12 }}>Hello</Text>
```

 ---

I've also added `void` to the `StyleValue`, as undefined seems to be handled fine, and can be a useful shorthand in JSX.

 ---

And finally, I've allowed nesting of style prop arrays, by making StyleProp self-referencing, as RN seems to flatten those without issue.  This can be important if you're passing in a style prop quite high up the component tree, and sticking it in an array with other styles at several points while it's passed down.

N/A (These types aren't referenced anywhere else)

[INTERNAL] [MINOR] [StyleSheet] - Refine Flow types
Closes https://github.com/facebook/react-native/pull/16741

Reviewed By: frantic

Differential Revision: D6278010

Pulled By: TheSavior

fbshipit-source-id: 0170a233ab71d29f445786f5e695463f9730db3a
2017-11-09 11:58:15 -08:00
..
2017-11-02 08:00:56 -07:00
2017-09-25 10:30:53 -07:00
2017-09-06 03:33:43 -07:00
2017-09-06 03:33:43 -07:00
2016-11-02 12:29:15 -07:00
2017-09-08 14:46:14 -07:00
2017-11-08 07:03:30 -08:00
2017-09-21 15:01:52 -07:00
2017-11-06 17:44:37 -08:00
2017-10-23 11:32:44 -07:00
2017-02-21 15:18:40 -08:00
2017-11-09 11:58:15 -08:00
2017-11-08 12:17:44 -08:00
2017-09-06 03:33:43 -07:00
2017-10-09 17:46:44 -07:00
2017-10-09 17:22:35 -07:00
2017-09-06 03:33:43 -07:00