163
rated 0 times
[
165]
[
2]
/ answers: 1 / hits: 8478
/ 5 Years ago, tue, november 19, 2019, 12:00:00
Yup.number().test('len', 'Must be exactly 5 characters', val => val && val.toString().length === 5)
It's not working correctly. If this field empty, gives a Must be exactly 5 characters, but should be show nothing.
More From » reactjs