Skip to content

Commit 8a81060

Browse files
committed
GH-10: Showcase the usage of primary functions
1 parent 5ec9c59 commit 8a81060

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ This library can be used to build a phone number input component with a country
1616
as to parse the phone metadata, validate phone numbers, format raw phone numbers into a more readable format and the
1717
opposite. You can use the [development](./development) to test and develop your own components.
1818

19-
### useMask
20-
2119
```jsx
22-
import {useMask} from "react-phone-hooks";
20+
import {getFormattedNumber, getMetadata, parsePhoneNumber, useMask} from "react-phone-hooks";
21+
22+
getMetadata("440201111111"); // ["gb", "United Kingdom", "44", "+44 (..) ... ....."]
23+
getFormattedNumber("440201111111", "+44 (..) ... ....."); // +44 (02) 011 11111
24+
parsePhoneNumber("+44 (02) 011 11111"); // {countryCode: 44, areaCode: "02", phoneNumber: "01111111", isoCode: "gb"}
2325

2426
const PhoneInput = (props) => {
2527
return <input {...useMask("+1 (...) ... ....")} {...props}/>

0 commit comments

Comments
 (0)