This is the Tag component
type Props = tag | tagIcon;
const Tag = ({ type, label, isSelected, onClick, ...icon }: Props) => {
const emoji = Object.values(icon)[0];
return (
<View
className={`rounded-full px-[10px] py-[2px] flex flex-row items-center self-start`}
>
<Text
className={`text-base`}
>
{label}
</Text>
{emoji !== undefined && <Text className="ml-1">{emoji}</Text>}
</View>
);
};
"interest.item.emoji" is the hexadecimal code of the emoji and when rendering only the code is shown
<FlatList
data={selectedInterest}
ItemSeparatorComponent={() => <Gap direction="horizontal" size={20} />}
renderItem={(interest) => (
<Tag
type="selectedIcon"
label={interest.item.name}
icon={interest.item.emoji}
key={uuid.v4().toString()}
isSelected
onClick={() => handleSelectInterest(interest.item)}
/>
)}
/>
Only the hexadecimal code of the emoji is shown
2
Answers
when I pass the value of the direct emoji if it works
icon="🚀"
, but in all it would be the same emoji as in the imageenter image description here
I found the solution with a npm package
npm install html-entities