我试图在 setvalueas 的帮助下在改变反应钩子形式时调用一个函数,但它运行了三次而不是一次。有人可以帮我吗。这是我的代码
placeholder={t("community_placeholder")}
id="community-name"
{...register("communityName", {
required: String(
t("register_community_movement_message")
),
maxLength: {
value: 100,
message: t("max_character_3"),
},
setValueAs:(value:any)=>isOrganizationExist(value),