Skip to content

Commit

Permalink
reformatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
taeh98 committed Oct 1, 2023
1 parent 070e86f commit 9452b30
Show file tree
Hide file tree
Showing 9 changed files with 1,174 additions and 5,250 deletions.
4 changes: 2 additions & 2 deletions examples/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const EXAMPLE_COMPONENT_ITEMS: Array<ItemType<ExampleComponent>> = [
];

type Props = Record<string, never>;
type State = {
interface State {
currentExample: ExampleComponent;
examplePickerOpen: boolean;
exampleComponents: Array<ItemType<ExampleComponent>>;
};
}

export default class App extends React.Component<Props, State> {
constructor(props: Readonly<Props>) {
Expand Down
10 changes: 5 additions & 5 deletions examples/example-src-files/typescript-class-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { Component } from 'react';
import { Button, Text, View } from 'react-native';
import DropDownPicker, { ItemType } from 'react-native-dropdown-picker';

type Props = {
interface Props {
multiple: boolean;
};
type State = {
}
interface State {
open: boolean;
singleValue: string | null;
multiValue: string[] | null;
multiValue: Array<string> | null;
items: Array<ItemType<string>>;
};
}

export default class TypescriptClassExample extends Component<Props, State> {
constructor(props: Readonly<Props>) {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-src-files/typescript-function-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function TypescriptFunctionExample(props: {
}): JSX.Element {
const [open, setOpen] = useState<boolean>(false);
const [singleValue, setSingleValue] = useState<string | null>(null);
const [multiValue, setMultiValue] = useState<string[] | null>(null);
const [multiValue, setMultiValue] = useState<Array<string> | null>(null);
const [items, setItems] = useState<Array<ItemType<string>>>([
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare module 'react-native-dropdown-picker' {

export type ValueType = string | number | boolean;

export type ItemType<T extends ValueType> = {
export interface ItemType<T extends ValueType> {
containerStyle?: StyleProp<ViewStyle>;
disabled?: boolean;
icon?: () => JSX.Element;
Expand All @@ -32,7 +32,7 @@ declare module 'react-native-dropdown-picker' {
selectable?: boolean;
testID?: string;
value?: T;
};
}

export type ModeType = 'DEFAULT' | 'SIMPLE' | 'BADGE';

Expand Down
Loading

0 comments on commit 9452b30

Please sign in to comment.