hossein-zare / react-native-dropdown-picker

A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.
https://hossein-zare.github.io/react-native-dropdown-picker-website/
MIT License
970 stars 294 forks source link

how do I style multipleText ? #677

Closed Bucci83 closed 1 year ago

Bucci83 commented 1 year ago

I've been trying to style multipleText labels with no luck, here is the sample

<DropDownPicker multipleText={<Text>${value.length == 1 ? value : 'multi status' }</Text>} ... />

i get the error ERROR TypeError: Cannot read property 'replace' of undefined

This error is located at: in Picker (at AdminJobsScreen.js:423) in RCTView (at View.js:32) in View (at AdminJobsScreen.js:393) in RCTView (at View.js:32) in View (at AdminJobsScreen.js:391) in RCTView (at View.js:32) in View (at AdminJobsScreen.js:356) in AdminJobsScreen (at SceneView.tsx:132) in StaticContainer in EnsureSingleNavigator (at SceneView.tsx:124) in SceneView (at useDescriptors.tsx:217) in RCTView (at View.js:32) in View (at DebugContainer.native.tsx:27) in DebugContainer (at NativeStackView.native.tsx:82) in MaybeNestedStack (at NativeStackView.native.tsx:326) in RCTView (at View.js:32) in View (at NativeStackView.native.tsx:319) in RNSScreen (at createAnimatedComponent.js:211) in AnimatedComponent (at createAnimatedComponent.js:264) in AnimatedComponentWrapper (at src/index.native.tsx:260) in Suspender (at src/index.tsx:40)

any ideas on how to do it ?

Bucci83 commented 1 year ago

nevermind, I was able to do it by adding textStyle={{color:'white',fontWeight: 'bold', textAlign: 'center'}}