How to Disable Picker Component in React Native

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.

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

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

Leave a Reply

%d bloggers like this: