import React from 'react'; import { Text } from 'react-native'; import { connectHighlight } from 'react-instantsearch-native'; export default connectHighlight( ({ highlight, attribute, hit, highlightProperty, inverted }) => { const parsedHit = highlight({ attribute, hit, highlightProperty }); const styles = inverted ? {} : { backgroundColor: '#ffff99' }; const highligtedHit = parsedHit.map((part, idx) => { if (part.isHighlighted) return ( {part.value} ); return ( {part.value} ); }); return {highligtedHit}; } );