import * as React from 'react'; import { Dropdown, DropDownData, RenderBaseProps } from 'react-native-material-dropdown'; import { LayoutChangeEvent, LayoutRectangle, Text, View } from 'react-native'; interface DropdownTestProps { title: string; } class DropdownTest extends React.Component { private layout: LayoutRectangle; private isFocused: boolean; private curText: string; render(): JSX.Element { const dropdownData: DropDownData[] = [ { label: 'Apple', value: 'apple' }, { label: 'Orange', value: 'orange' }, { label: 'Peach', value: 'peach', props: { disabled: true }, } ]; return (
{this.props.title} item.props ? item.props : {}} onLayout={(event: LayoutChangeEvent) => this.layout = event.nativeEvent.layout} onFocus={() => this.isFocused = true} onBlur={() => this.isFocused = false} onChangeText={(value: string) => this.curText = value} /> {props.title}} />
); } } export default DropdownTest;