Skip to content

Commit 73c546f

Browse files
jacobloganJacob Logan
andauthored
remove deprecation console warning from countryCodeSelect usage (#2528)
* remove deprecation warning from countryCodeSelect usage * Create brave-emus-ring.md Co-authored-by: Jacob Logan <[email protected]>
1 parent 0dd3e16 commit 73c546f

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

.changeset/brave-emus-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@aws-amplify/ui-react": patch
3+
---
4+
5+
remove deprecation console warning from countryCode prop usage

packages/react/src/primitives/PhoneNumberField/PhoneNumberField.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { CountryCodeSelect } from './CountryCodeSelect';
66
import { PhoneNumberFieldProps, Primitive } from '../types';
77
import { ComponentText } from '../shared/constants';
88
import { TextField } from '../TextField';
9-
import { useDeprecationWarning } from '../../hooks/useDeprecationWarning';
109

1110
const PhoneNumberFieldPrimitive: Primitive<PhoneNumberFieldProps, 'input'> = (
1211
{
@@ -41,20 +40,6 @@ const PhoneNumberFieldPrimitive: Primitive<PhoneNumberFieldProps, 'input'> = (
4140
const onCodeChange = onDialCodeChange || onCountryCodeChange;
4241
const codeRef = dialCodeRef || countryCodeRef;
4342

44-
const deprecationMessage =
45-
'The PhoneNumberField component props: countryCodeName, countryCodeLabel, defaultCountryCode, onCountryCodeChange, and countryCodeRef props are deprecated and will be removed in the next major release of @aws-amplify/ui-react. Please update to dialCodeName, dialCodeLabel, defaultDialCode, onDialCodeChange, and dialCodeRef respectively.';
46-
const shouldWarn =
47-
countryCodeName ||
48-
countryCodeLabel !== ComponentText.PhoneNumberField.countryCodeLabel ||
49-
defaultCountryCode ||
50-
onCountryCodeChange ||
51-
countryCodeRef;
52-
53-
useDeprecationWarning({
54-
shouldWarn: !!shouldWarn,
55-
message: deprecationMessage,
56-
});
57-
5843
return (
5944
<TextField
6045
outerStartComponent={

0 commit comments

Comments
 (0)