import React from 'react'; import { Form, Input, InputNumber, Typography } from 'antd'; const Demo: React.FC = () => { const [form] = Form.useForm<{ name: string; age: number }>(); const nameValue = Form.useWatch('name', form); // The selector is static and does not support closures. const customValue = Form.useWatch((values) => `name: ${values.name || ''}`, form); return ( <>
Name Value: {nameValue}
Custom Value: {customValue}
); }; export default Demo;