Skip to content

Commit

Permalink
Rename the default component name
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomVancyan committed Feb 28, 2023
1 parent 6469606 commit f6667c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ChangeEvent, useMemo, useState} from "react";
import PhoneInput from "react-phone-input-2";
import ReactPhoneInput from "react-phone-input-2";

import masks from "./phoneMasks.json";
import timezones from "./timezones.json";
Expand Down Expand Up @@ -37,7 +37,7 @@ const getDefaultISO2Code = () => {
return timezones[timezone].toLowerCase() || "us";
}

const PhoneNumberInput = ({value = {}, onChange: handleChange}: PhoneNumberInputProps) => {
const PhoneInput = ({value = {}, onChange: handleChange}: PhoneNumberInputProps) => {
const [currentCode, setCurrentCode] = useState("");
const rawPhone = useMemo(() => Object.values(value).map(v => v || "").join(""), [value]);

Expand Down Expand Up @@ -70,7 +70,7 @@ const PhoneNumberInput = ({value = {}, onChange: handleChange}: PhoneNumberInput
};

return (
<PhoneInput
<ReactPhoneInput
enableSearch
masks={masks}
enableAreaCodes
Expand All @@ -83,4 +83,4 @@ const PhoneNumberInput = ({value = {}, onChange: handleChange}: PhoneNumberInput
)
}

export default PhoneNumberInput;
export default PhoneInput;

0 comments on commit f6667c9

Please sign in to comment.