Fix all warnings for missing keys.
Summary: I had to go through each component while debugging for another issue and decided to clean these warnings up along the way. Closes https://github.com/facebook/react-native/pull/4653 Reviewed By: svcscm Differential Revision: D2752740 Pulled By: androidtrunkagent fb-gh-sync-id: 94da8ad693cae04e353f33f540c15214f6f3e7d8
This commit is contained in:
Родитель
bd3cb3ae1d
Коммит
e4fe557089
|
@ -195,6 +195,7 @@ exports.examples = [
|
|||
{['Composite', 'Easing', 'Animations!'].map(
|
||||
(text, ii) => (
|
||||
<Animated.View
|
||||
key={text}
|
||||
style={[styles.content, {
|
||||
left: this.anims[ii]
|
||||
}]}>
|
||||
|
|
|
@ -80,7 +80,7 @@ var BasicStorageExample = React.createClass({
|
|||
</Text>
|
||||
<Text>{' '}</Text>
|
||||
<Text>Messages:</Text>
|
||||
{this.state.messages.map((m) => <Text>{m}</Text>)}
|
||||
{this.state.messages.map((m) => <Text key={m}>{m}</Text>)}
|
||||
</View>
|
||||
);
|
||||
},
|
||||
|
|
|
@ -79,8 +79,8 @@ var CameraRollExample = React.createClass({
|
|||
var location = asset.node.location.longitude ?
|
||||
JSON.stringify(asset.node.location) : 'Unknown location';
|
||||
return (
|
||||
<TouchableOpacity onPress={ this.loadAsset.bind( this, asset ) }>
|
||||
<View key={asset} style={styles.row}>
|
||||
<TouchableOpacity key={asset} onPress={ this.loadAsset.bind( this, asset ) }>
|
||||
<View style={styles.row}>
|
||||
<Image
|
||||
source={asset.node.image}
|
||||
style={imageStyle}
|
||||
|
|
|
@ -84,8 +84,8 @@ const PullToRefreshViewAndroidExample = React.createClass({
|
|||
},
|
||||
|
||||
render() {
|
||||
const rows = this.state.rowData.map((row) => {
|
||||
return <Row data={row} onClick={this._onClick}/>;
|
||||
const rows = this.state.rowData.map((row, ii) => {
|
||||
return <Row key={ii} data={row} onClick={this._onClick}/>;
|
||||
});
|
||||
return (
|
||||
<PullToRefreshViewAndroid
|
||||
|
|
|
@ -33,7 +33,7 @@ exports.examples = [{
|
|||
return (
|
||||
<View>
|
||||
{['default', 'light-content'].map((style) =>
|
||||
<TouchableHighlight style={styles.wrapper}
|
||||
<TouchableHighlight key={style} style={styles.wrapper}
|
||||
onPress={() => StatusBarIOS.setStyle(style)}>
|
||||
<View style={styles.button}>
|
||||
<Text>setStyle('{style}')</Text>
|
||||
|
@ -49,7 +49,7 @@ exports.examples = [{
|
|||
return (
|
||||
<View>
|
||||
{['default', 'light-content'].map((style) =>
|
||||
<TouchableHighlight style={styles.wrapper}
|
||||
<TouchableHighlight key={style} style={styles.wrapper}
|
||||
onPress={() => StatusBarIOS.setStyle(style, true)}>
|
||||
<View style={styles.button}>
|
||||
<Text>setStyle('{style}', true)</Text>
|
||||
|
@ -65,7 +65,7 @@ exports.examples = [{
|
|||
return (
|
||||
<View>
|
||||
{['none', 'fade', 'slide'].map((animation) =>
|
||||
<View>
|
||||
<View key={animation}>
|
||||
<TouchableHighlight style={styles.wrapper}
|
||||
onPress={() => StatusBarIOS.setHidden(true, animation)}>
|
||||
<View style={styles.button}>
|
||||
|
|
|
@ -158,7 +158,7 @@ class TokenizedTextExample extends React.Component {
|
|||
//highlight hashtags
|
||||
parts = parts.map((text) => {
|
||||
if (/^#/.test(text)) {
|
||||
return <Text style={styles.hashtag}>{text}</Text>;
|
||||
return <Text key={text} style={styles.hashtag}>{text}</Text>;
|
||||
} else {
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -171,9 +171,20 @@ exports.examples = [
|
|||
}
|
||||
return (
|
||||
<View>
|
||||
{timer}
|
||||
{this.state.showTimer && this._renderTimer()}
|
||||
<UIExplorerButton onPress={this._toggleTimer}>
|
||||
{toggleText}
|
||||
{this.state.showTimer ? 'Unmount timer' : 'Mount new timer'}
|
||||
</UIExplorerButton>
|
||||
</View>
|
||||
);
|
||||
},
|
||||
|
||||
_renderTimer: function() {
|
||||
return (
|
||||
<View>
|
||||
<TimerTester ref="interval" dt={25} type="setInterval" />
|
||||
<UIExplorerButton onPress={() => this.refs.interval.clear() }>
|
||||
Clear interval
|
||||
</UIExplorerButton>
|
||||
</View>
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче