Phone Number Input With Flag ,Country Phone Code And Country Search component.
npm install --save phone-number-input-search
import React from "react";
import ReactPhoneInput from "phone-number-input-search";
class Example extends Component {
const [phone, setPhone] = React.useState(null); // the lifted state
const getPhoneNumberFun = (data) => { // the callback. Use a better name
console.log(data); // print phone number - to test
setPhone(data);
};
render() {
return (
<ReactPhoneInput getPhoneNumber={getPhoneNumberFun}/>
);
}
}
Property | Type | Default | Description |
---|---|---|---|
getPhoneNumber |
function | "() => {}" | Return phone number with code |
MIT © Nazeh-Taha