fateh999 / react-native-paper-dropdown

Dropdown using react native paper TextInput and Menu
121 stars 72 forks source link

Undefined is not an object #59

Open galih56 opened 2 years ago

galih56 commented 2 years ago

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