import React from 'react'; import { Alert, Form, Input, Typography } from 'antd'; const App: React.FC = () => { const [form] = Form.useForm(); return (
{/* Field */} ({ validator(_, value) { if (!value || getFieldValue('password') === value) { return Promise.resolve(); } return Promise.reject(new Error('The new password that you entered do not match!')); }, }), ]} > {/* Render Props */} {() => (

Only Update when password2 updated:

{JSON.stringify(form.getFieldsValue(), null, 2)}
)}
); }; export default App;