Added null handling for phone formatter IO-483

This commit is contained in:
Patrick Fic
2021-02-03 11:38:18 -08:00
parent b1a2134dd3
commit 0b849b6a91

View File

@@ -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;
}