Reputation: 9457
Im working on a react native app. I used react-native-elements library. The SearchBar component doesn't take the icon propery. I have imported react-native-vector-icon package as well. How to put an icon to the SearchBar?
<SearchBar
placeholder="Type Comment"
inputStyle={[styles.searchBar]}
// noIcon={true}
icon = {{type: 'MaterialCommunityIcons', color: '#86939e', name: 'share' }}
clearIcon = {{type: 'MaterialCommunityIcons', color: '#86939e', name: 'share' }}
round={true}
Upvotes: 0
Views: 4841
Reputation: 22189
Looking at the docs, i think the type should be material-community
and not MaterialCommunityIcons
<SearchBar
placeholder="Type Comment"
inputStyle={[styles.searchBar]}
// noIcon={true}
icon = {{type: 'material-community', color: '#86939e', name: 'share' }}
clearIcon = {{type: 'material-community', color: '#86939e', name: 'share' }}
round={true}
Upvotes: 2