Stop expose Image.resizeMode

Summary:
Exposing this enum is essentially useless and at worst is a runtime cost that isn't necessary by just using the string.

The value of this enum, as far as I understand it, is to enforce that only valid options are used. We can enforce this at build time with Flow.

I was able to migrate our codebase with a few Find and Replace for things like

```
resizeMode={Image.resizeMode.contain}
```

Reviewed By: yungsters

Differential Revision: D7983982

fbshipit-source-id: ddd7024023f8d2f01aad1fff6c8103983a1bec1a
This commit is contained in:
Eli White
2018-05-12 23:10:57 -07:00
committed by Facebook Github Bot
parent a9a612bfb6
commit 870775ee73
4 changed files with 7 additions and 12 deletions

View File

@@ -621,7 +621,7 @@ exports.examples = [
<Text style={[styles.resizeModeText]}>Contain</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.contain}
resizeMode="contain"
source={image}
/>
</View>
@@ -629,7 +629,7 @@ exports.examples = [
<Text style={[styles.resizeModeText]}>Cover</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.cover}
resizeMode="cover"
source={image}
/>
</View>
@@ -639,7 +639,7 @@ exports.examples = [
<Text style={[styles.resizeModeText]}>Stretch</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.stretch}
resizeMode="stretch"
source={image}
/>
</View>
@@ -647,7 +647,7 @@ exports.examples = [
<Text style={[styles.resizeModeText]}>Repeat</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.repeat}
resizeMode="repeat"
source={image}
/>
</View>
@@ -655,7 +655,7 @@ exports.examples = [
<Text style={[styles.resizeModeText]}>Center</Text>
<Image
style={styles.resizeMode}
resizeMode={Image.resizeMode.center}
resizeMode="center"
source={image}
/>
</View>