Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function RegistrationForm() {
const [state, setState] = useState({
confirmDirty: false,
autoCompleteResult: []
});
const form = useForm();
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
form
.validateFields(['transfer'])
.then(() => console.log('Received values of form: ', form.values));
};
const handleConfirmBlur = (e: any) => {
const { value } = e.target;
setState({ ...state, confirmDirty: state.confirmDirty || !!value });
};
const compareToFirstPassword = (rule: any, value: any, callback: any) => {
if (value && value !== form.getFieldValue('password')) {
callback('Two passwords that you enter is inconsistent!');