Closed TrejGun closed 3 years ago
feature request
errorKeys are not exposed
errorKeys are exposed
curent code
var errorKeys = ['badInput', 'patternMismatch', 'rangeOverflow', 'rangeUnderflow', 'stepMismatch', 'tooLong', 'tooShort', 'typeMismatch', 'valueMissing']; /// ... export { Html5ValidationField as Field };
desireble code
var errorKeys = ['badInput', 'patternMismatch', 'rangeOverflow', 'rangeUnderflow', 'stepMismatch', 'tooLong', 'tooShort', 'typeMismatch', 'valueMissing']; //... export { Html5ValidationField as Field , errorKeys};
so i can consume it in my app like this
import {Field, errorKeys} from "react-final-form-html5-validation"; export default props => { const messages = {}; errorKeys.forEach(key => { messages[key] = `My localized ${key}`; }); return <Field {...props} {...messages} />; }
Are you submitting a bug report or a feature request?
feature request
What is the current behavior?
errorKeys are not exposed
What is the expected behavior?
errorKeys are exposed
curent code
desireble code
so i can consume it in my app like this