peacechen / react-native-modal-selector

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.
MIT License
369 stars 129 forks source link

setting initValue as icon #86

Closed randomkrishna closed 6 years ago

randomkrishna commented 6 years ago

I want to set initValue as an icon and even after onChange it should be the same icon. How can I achieve this?

randomkrishna commented 6 years ago

I found the solution, we have to place our Icon in Text component then it works. const rightIcon = <Text><FontAwesomeIcon name="menu" size={30} color="#fff" /></Text>; <ModalSelector data={data} initValue={rightIcon} />

peacechen commented 6 years ago

@randomkrishna

Try using the icon directly. For instance:

const rightIcon = <FontAwesomeIcon name="menu" size={30} color="#fff" />;