mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import * as React from 'react';
|
|
import PhoneInput from 'react-phone-number-input';
|
|
|
|
const test1 = (
|
|
<PhoneInput
|
|
value={'+64271231234'}
|
|
onChange={(value: string) => {
|
|
console.log(value);
|
|
}}
|
|
displayInitialValueAsLocalNumber={false}
|
|
disabled={false}
|
|
autoComplete="tel"
|
|
defaultCountry="NZ"
|
|
countries={['NZ', 'US', 'FR']}
|
|
placeholder="Place holder"
|
|
international={true}
|
|
country={'US'}
|
|
>
|
|
<div>panel 1</div>
|
|
<div>panel 2</div>
|
|
<div>panel 3</div>
|
|
</PhoneInput>
|
|
);
|
|
|
|
const InputComponent = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>((props, ref) => (
|
|
<input ref={ref} {...props} />
|
|
));
|
|
|
|
const test2 = (
|
|
<PhoneInput
|
|
value={'+64271231234'}
|
|
onChange={(value: string) => {
|
|
console.log(value);
|
|
}}
|
|
addInternationalOption
|
|
countryOptionsOrder={['US', 'CA', 'AU', '|', '...']}
|
|
disabled
|
|
inputComponent={InputComponent}
|
|
numberInputProps={{ type: 'tel' }}
|
|
smartCaret={false}
|
|
/>
|
|
);
|