Skip to content

Commit 060bd73

Browse files
cpojerfacebook-github-bot
authored andcommitted
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
1 parent 844e119 commit 060bd73

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Libraries/Image/nativeImageSource.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type NativeImageSource = {|
2323
type NativeImageSourceSpec = {|
2424
+android?: string,
2525
+ios?: string,
26+
+default?: string,
2627

2728
// For more details on width and height, see
2829
// http://facebook.github.io/react-native/docs/images.html#why-not-automatically-size-everything
@@ -47,7 +48,11 @@ type NativeImageSourceSpec = {|
4748
*
4849
*/
4950
function nativeImageSource(spec: NativeImageSourceSpec): Object {
50-
let uri = Platform.select(spec);
51+
let uri = Platform.select({
52+
android: spec.android,
53+
default: spec.default,
54+
ios: spec.ios,
55+
});
5156
if (uri == null) {
5257
console.warn(
5358
'nativeImageSource(...): No image name supplied for `%s`:\n%s',

0 commit comments

Comments
 (0)