react-native-paper-dropdown
react-native-paper-dropdown copied to clipboard
Undefined is not an object
Error occurs when i use theme to react-native-paper-dropdown and shows "Undefined is not an object (evaluating '(theme || activeTheme).colors.text').
import React, {useState} from "react";
import PropTypes from 'prop-types';
import DropDown from "react-native-paper-dropdown";
import { TextInput } from "react-native-paper";
export function Select({label, onChange, items, selectedItem, value, textInputMode, ...props}){
const [showDropDown, setShowDropDown] = useState(false);
const [gender, setGender] = useState("");
return(
<DropDown
theme={{roundness:15}}
label={label}
visible={showDropDown}
showDropDown={() => setShowDropDown(true)}
onDismiss={() => setShowDropDown(false)}
value={gender}
setValue={setGender}
list={items}
mode={textInputMode}
dropDownStyle={{backgroundColor:'white',borderRadius:15}}
inputProps={{ right: <TextInput.Icon name={'menu-down'}/>}
}
/>
)
}
Select.propTypes={
onChange: PropTypes.func,
value:PropTypes.string,
multiEnable:PropTypes.bool,
items: PropTypes.array,
textInputMode: PropTypes.string
}
I want to use borderRadius styling. But dropdownStyle doesn't work