Skip to content

Commit 6aa4574

Browse files
HimanshuHimanshu
authored andcommitted
remove warnings
1 parent c01e477 commit 6aa4574

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Components/Widgets/Header.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,40 +93,40 @@ export default class Header extends NativeBaseComponent {
9393

9494
if (this.props.searchBar) {
9595
if (Platform.OS === 'ios') {
96-
newChildren.push(<View style={{flex: 1, alignSelf: 'stretch', alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -7}}>
96+
newChildren.push(<View key='search' style={{flex: 1, alignSelf: 'stretch', alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -7}}>
9797
{React.cloneElement(input[0],{style: this.getInitialStyle().iosToolbarSearch, toolbar : true, key : 'inp'})}
9898
</View>)
99-
newChildren.push(<View style={{alignItems: 'center', justifyContent: 'center', flexDirection: 'row', marginRight: -14}}>
99+
newChildren.push(<View key='searchBtn' style={{alignItems: 'center', justifyContent: 'center', flexDirection: 'row', marginRight: -14}}>
100100
{React.cloneElement(buttons[0], {color: this.getTheme().iosToolbarBtnColor})}
101101
</View>)
102102
} else {
103-
newChildren.push(<View style={{flex: 1,alignItems: 'center', paddingBottom: 4, justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -8, marginRight: -8}}>
103+
newChildren.push(<View key='search' style={{flex: 1,alignItems: 'center', paddingBottom: 4, justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -8, marginRight: -8}}>
104104
{React.cloneElement(input[0],{style: this.getInitialStyle().androidToolbarSearch, atoolbar : true})}
105105
</View>)
106106
}
107107
}
108108
else {
109109
if (Platform.OS === 'ios') {
110-
newChildren.push(<View style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -14}}>
110+
newChildren.push(<View key='btn1' style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -14}}>
111111
{React.cloneElement(buttons[0], {color: this.getTheme().iosToolbarBtnColor})}
112112
</View>)
113-
newChildren.push(<View style={{flex: 3, alignSelf: 'center', justifyContent: 'space-between'}}>
113+
newChildren.push(<View key='title' style={{flex: 3, alignSelf: 'center', justifyContent: 'space-between'}}>
114114
{[title[0],subtitle[0]]}
115115
</View>)
116116
for (let i = 1; i < buttons.length; i++) {
117-
newChildren.push(<View style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -14}}>
117+
newChildren.push(<View key={'btn' + (i+1)} style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -14}}>
118118
{React.cloneElement(buttons[i], {color: this.getTheme().iosToolbarBtnColor})}
119119
</View>)
120120
}
121121
} else {
122-
newChildren.push(<View style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -10, marginRight: 12}}>
122+
newChildren.push(<View key='btn1' style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginLeft: -10, marginRight: 12}}>
123123
{buttons[0]}
124124
</View>)
125-
newChildren.push(<View style={{flex: 3, alignSelf: 'stretch'}}>
125+
newChildren.push(<View key='title' style={{flex: 3, alignSelf: 'stretch'}}>
126126
{[title[0]]}
127127
</View>)
128128
for (let i = 1; i < buttons.length; i++) {
129-
newChildren.push(<View style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -7}}>
129+
newChildren.push(<View key={'btn' + (i+1)} style={{alignItems: 'center', justifyContent: 'flex-start', flexDirection: 'row', marginRight: -7}}>
130130
{buttons[i]}
131131
</View>)
132132

0 commit comments

Comments
 (0)