mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[react-native] Fix Picker component definitions + test (#42024)
* add test to show the problem * make it work
This commit is contained in:
Vendored
+1
-1
@@ -2994,7 +2994,7 @@ export class Picker extends React.Component<PickerProps> {
|
||||
*/
|
||||
static MODE_DROPDOWN: string;
|
||||
|
||||
static Item: React.Component<PickerItemProps>;
|
||||
static Item: React.ComponentType<PickerItemProps>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,6 +81,7 @@ import {
|
||||
Modal,
|
||||
TimePickerAndroid,
|
||||
DatePickerAndroid,
|
||||
Picker,
|
||||
ViewPropTypes,
|
||||
requireNativeComponent,
|
||||
Keyboard,
|
||||
@@ -898,6 +899,13 @@ const DatePickerAndroidTest = () => {
|
||||
});
|
||||
}
|
||||
|
||||
const PickerTest = () => (
|
||||
<Picker mode="dropdown" selectedValue="v1" onValueChange={(val: string) => {}}>
|
||||
<Picker.Item label="Item1" value="v1" />
|
||||
<Picker.Item label="Item2" value="v2" />
|
||||
</Picker>
|
||||
);
|
||||
|
||||
class BridgedComponentTest extends React.Component {
|
||||
static propTypes = {
|
||||
jsProp: PropTypes.string.isRequired,
|
||||
|
||||
Reference in New Issue
Block a user