retyui / react-native-confirmation-code-field

A react-native confirmation code field compatible with iOS, Android and Web
MIT License
1.07k stars 125 forks source link

Custom Cursor color #224

Closed andrehadianto closed 1 year ago

andrehadianto commented 1 year ago

How can I change the color of the cursor?

retyui commented 1 year ago

you can apply a custom text color:

<Text
            key={index}
            style={[styles.cell, isFocused && styles.focusCell]}
            onLayout={getCellOnLayoutHandler(index)}>
-            {symbol || (isFocused ? <Cursor /> : null)}
+            {symbol || (isFocused ? <Text style={{color:'red'}}><Cursor /></Text> : null)}
</Text>