Fix `Platform.select` related flow errors [3/N]

Summary: This diff adds or fixes type annotations on a variety of files around RN.

Reviewed By: sahrens

Differential Revision: D13318808

fbshipit-source-id: dc466938167fda1ed7d6c9423c6cafe8040602e6
This commit is contained in:
Christoph Nakazawa 2018-12-05 21:46:45 -08:00 committed by Facebook Github Bot
parent 844e11967d
commit 060bd73e4e
1 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@ export type NativeImageSource = {|
type NativeImageSourceSpec = {|
+android?: string,
+ios?: string,
+default?: string,
// For more details on width and height, see
// http://facebook.github.io/react-native/docs/images.html#why-not-automatically-size-everything
@ -47,7 +48,11 @@ type NativeImageSourceSpec = {|
*
*/
function nativeImageSource(spec: NativeImageSourceSpec): Object {
let uri = Platform.select(spec);
let uri = Platform.select({
android: spec.android,
default: spec.default,
ios: spec.ios,
});
if (uri == null) {
console.warn(
'nativeImageSource(...): No image name supplied for `%s`:\n%s',