Added null handling for phone formatter IO-483
This commit is contained in:
@@ -3,6 +3,6 @@ import parsePhoneNumber from "libphonenumber-js";
|
||||
import React from "react";
|
||||
|
||||
export default function PhoneNumberFormatter(props) {
|
||||
const p = parsePhoneNumber(props.children, "CA");
|
||||
const p = parsePhoneNumber(props.children || "", "CA");
|
||||
return p ? <span>{p.formatInternational()}</span> : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user