Files
react-native/Libraries
Alexander Perepelitsyn 2b6599e9c8 Make Flow and PropType types checks consistent for view style props. (#20773)
Summary:
Description:
------------
While creating a custom component I added a prop `style: ?ViewStyleProp`. When I tried to pass the following object
```
style={{
  opacity: new Animated.Value(0),
}}
```
to this `style` prop I received a yellow box with the warning:
```
Warning: Failed prop type: Invalid prop `opacity` of type `object` supplied to `MyComponent`, expected `number`.
```

Then I browsed through the source code and found an inconsistency in types checks. Namely,
https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/StyleSheetTypes.js#L158 has the following declaration `opacity?: number | AnimatedNode`, whereas https://github.com/facebook/react-native/blob/master/Libraries/Components/View/ViewStylePropTypes.js#L50 is willing to accept **only** a `number`: `opacity: ReactPropTypes.number`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20773

Differential Revision: D9464634

Pulled By: TheSavior

fbshipit-source-id: fa21f706cb890dbeec136f1c4fab468904cd284b
2018-08-22 12:31:20 -07:00
..
2018-05-10 19:10:38 -07:00
2018-07-19 19:02:13 -07:00
2018-06-06 05:32:06 -07:00
2018-08-18 22:19:34 -07:00
2018-05-10 19:10:38 -07:00
2018-06-19 23:48:12 -07:00
2018-08-14 16:32:11 -07:00
2018-05-10 19:10:38 -07:00
2018-05-10 19:10:38 -07:00
2018-07-31 21:01:41 -07:00
2018-08-09 10:47:58 -07:00
2018-03-08 12:10:14 -08:00
2018-05-10 19:10:38 -07:00