How to Disable Picker Component in React Native

Last Updated on December 11, 2020.

Sometimes, you may need to disable the picker component to avoid any further actions related to the same.

In order to disable picker component in React Native you just need to use its enabled prop. Set enabled as false to make the picker disabled.

Like the example given below.

<Picker
        selectedValue={language}
        style={{height: 50, width: 100}}
        enabled={false}
        prompt="Choose Language"
        onValueChange={(itemValue, itemIndex) => setlanguage(itemValue)}>
        <Picker.Item label="Java" value="java" />
        <Picker.Item label="JavaScript" value="js" />
      </Picker>

1 thought on “How to Disable Picker Component in React Native”

Leave a Reply

%d bloggers like this: