前言
在上一篇文章中,我们介绍了react-hook-form-mui
的基础用法。本文将着表单数据处理。
react-hook-form-mui
提供了丰富的表单数据处理功能,可以通过watch
属性来获取表单数据。
Demo
下面是一个使用watch
属性的例子:
import React from 'react';
import {
useForm } from 'react-hook-form';
import {
Button } from '@mui/material';
import {
FormContainer, TextFieldElement } from 'react-hook-form-mui';
export interface UserSettings {
firstName: string;