Skip to content

Error: Exception in HostFunction: TypeError: expected dynamic type string', but had type null' #659

Open
@LongHP105

Description

@LongHP105

Describe the bug

When tapping on the react-native-picker-select dropdown, it throws the following error instead of opening:
Warning: Error: Exception in HostFunction: TypeError: expected dynamic typestring', but had type null'

To Reproduce

Expected behavior

The picker should open normally and allow the user to select an option without throwing an error.

Screenshots

Image

Additional details

  • Device: iPhone 16 Pro Max
  • OS: iOS 17+
  • react-native-picker-select version: ^9.3.1
  • react-native version: 0.76.6
  • react version: 18.3.1
  • expo sdk version: 52.0.28
  • React Native new architecture: Enabled

Reproduction and/or code sample

import React, { useState } from 'react';
import { View } from 'react-native';
import RNPickerSelect from 'react-native-picker-select';

const App = () => {
  const [value, setValue] = useState(null);

  return (
    <View style={{ flex: 1, justifyContent: 'center', padding: 20 }}>
      <RNPickerSelect
        onValueChange={(val) => setValue(val)}
        items={[
          { label: 'Option 1', value: '1' },
          { label: 'Option 2', value: '2' },
        ]}
        value={value} // Added explicitly
        style={{inputIOSContainer: {pointerEvents: "none"},


}}
      />
    </View>
  );
};

export default App;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions