[change] Image no longer accepts children

Align with recent changes to the React Native API.
This commit is contained in:
Nicolas Gallagher
2017-12-01 15:21:25 -08:00
parent b1e860ab40
commit 541d2458fb
5 changed files with 15 additions and 25 deletions
@@ -5,7 +5,6 @@
*/
import React from 'react';
import PropChildren from './examples/PropChildren';
import PropDefaultSource from './examples/PropDefaultSource';
import PropDraggable from './examples/PropDraggable';
import PropOnError from './examples/PropOnError';
@@ -35,15 +34,6 @@ const ImageScreen = () => (
<Section title="Props">
<DocItem name="...View props" />
<DocItem
name="children"
typeInfo="?any"
description="Content to display over the image."
example={{
render: () => <PropChildren />
}}
/>
<DocItem
name="defaultSource"
typeInfo="?object"
@@ -32,6 +32,7 @@ class NetworkImageExample extends PureComponent {
return (
<View>
{loader}
<Image
defaultSource={sources.placeholder}
onError={this._handleError}
@@ -40,9 +41,7 @@ class NetworkImageExample extends PureComponent {
onLoadStart={this._handleLoadStart}
source={this.props.source}
style={helpers.styles.base}
>
{loader}
</Image>
/>
{this.state.message && <Text style={helpers.styles.marginTop}>{this.state.message}</Text>}
</View>
);
@@ -4,12 +4,12 @@
import sources from '../sources';
import React from 'react';
import { Image, StyleSheet, Text } from 'react-native';
import { ImageBackground, StyleSheet, Text } from 'react-native';
const ImageChildrenExample = () => (
<Image source={sources.large} style={styles.image}>
<ImageBackground source={sources.large} style={styles.image}>
<Text style={styles.text}>Child content</Text>
</Image>
</ImageBackground>
);
const styles = StyleSheet.create({