d-a-n / react-native-multiple-choice

A cross-platform (iOS / Android) single and multiple-choice React Native component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how do i change style of the text in each option or reduce the width of separator? I tried doing it gives me a warning.

miteshrathod09 opened this issue · comments

I had the same problem trying to change the color of the text of my options and I had to reimplement the renderText function inside my component as below:

_renderText(option) {
     if(typeof this.props.renderText === 'function') {
         return this.props.renderText(option);
     }
     return (<Text style={styles.textStyle}>{option}</Text>);
}

And then use as this:

<MultipleChoice
          options={[
              'Lorem ipsum dolor sit',
              'Lorem ipsum',
              'Lorem ipsum dolor'
              ]}
          renderText={(option)=>this._renderText(option)}
   />

I hope this helps.

Best,
Vitor Cavalcanti

Thank you @vitorcavalcanti !