Skip to content

Commit faf65f2

Browse files
committed
Version upgrade for type fix to support react 19.
1 parent c7b701c commit faf65f2

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

example/src/index.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import { cardExpiry } from '../../custom_formatters/card_expiry';
1010
const persianNumeral = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
1111

1212
function CustomNumeralNumericFormat(props) {
13-
const { format, removeFormatting, isCharacterSame, ...rest } =
14-
useNumericFormat(props);
13+
const { format, removeFormatting, isCharacterSame, ...rest } = useNumericFormat(props);
1514

1615
const _format = (val) => {
1716
const _val = format(val);
@@ -20,21 +19,16 @@ function CustomNumeralNumericFormat(props) {
2019
};
2120

2221
const _removeFormatting = (val) => {
23-
const _val = val.replace(new RegExp(persianNumeral.join("|"), "g"), ($1) =>
24-
persianNumeral.indexOf($1)
22+
const _val = val.replace(new RegExp(persianNumeral.join('|'), 'g'), ($1) =>
23+
persianNumeral.indexOf($1),
2524
);
2625

2726
return removeFormatting(_val);
2827
};
2928

3029
const _isCharacterSame = (compareMeta) => {
3130
const isCharSame = isCharacterSame(compareMeta);
32-
const {
33-
formattedValue,
34-
currentValue,
35-
formattedValueIndex,
36-
currentValueIndex,
37-
} = compareMeta;
31+
const { formattedValue, currentValue, formattedValueIndex, currentValueIndex } = compareMeta;
3832
const curChar = currentValue[currentValueIndex];
3933
const newChar = formattedValue[formattedValueIndex];
4034
const curPersianChar = persianNumeral[Number(curChar)] ?? curChar;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-number-format",
33
"description": "React component to format number in an input or as a text.",
4-
"version": "5.4.3",
4+
"version": "5.4.4",
55
"main": "dist/react-number-format.cjs.js",
66
"module": "dist/react-number-format.es.js",
77
"types": "types/index.d.ts",

0 commit comments

Comments
 (0)