Fix warnings of StyleInspector

Summary:
Fix issue #5831
Closes https://github.com/facebook/react-native/pull/5832

Reviewed By: svcscm

Differential Revision: D2917760

Pulled By: vjeux

fb-gh-sync-id: 3808d14075b259dd21056a7111205edae1e3eb48
shipit-source-id: 3808d14075b259dd21056a7111205edae1e3eb48
This commit is contained in:
wusuopu 2016-02-10 08:40:01 -08:00 committed by facebook-github-bot-0
parent 197880518b
commit 97741af8b9
1 changed files with 2 additions and 2 deletions

View File

@ -25,13 +25,13 @@ class StyleInspector extends React.Component {
return (
<View style={styles.container}>
<View>
{names.map(name => <Text style={styles.attr}>{name}:</Text>)}
{names.map(name => <Text key={name} style={styles.attr}>{name}:</Text>)}
</View>
<View>
{names.map(name => {
var value = typeof this.props.style[name] === 'object' ? JSON.stringify(this.props.style[name]) : this.props.style[name];
return <Text style={styles.value}>{value}</Text>;
return <Text key={name} style={styles.value}>{value}</Text>;
} ) }
</View>
</View>