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:
parent
844e11967d
commit
060bd73e4e
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue