Closed imakou closed 1 year ago
Hi, I'm doing a feature of displaying credit card numbers. But I need to mask the numbers from the first to the 12th digits.
Says, if i give defaultValue="4111 1111 1111 1234". How can I display like "**** **** **** 1234" in the input field?
defaultValue="4111 1111 1111 1234"
"**** **** **** 1234"
Thanks!
n/a
answer:
format={ `**** **** **** `${"4111 1111 1111 1234".slice(-4)}` }
Describe the issue and the actual behavior
Hi, I'm doing a feature of displaying credit card numbers. But I need to mask the numbers from the first to the 12th digits.
Describe the expected behavior
Says, if i give
defaultValue="4111 1111 1111 1234"
. How can I display like"**** **** **** 1234"
in the input field?Thanks!
Provide a CodeSandbox link illustrating the issue
n/a
Provide steps to reproduce this issue
n/a
Please check the browsers where the issue is seen