小编ali*_*aha的帖子

如何从woocommerce中的链接产品中获取分组的产品ID

我有一个分组产品product-1,它有许多链接产品:

-product-1(分组产品)

  • |__ product-2(简单或可变产品)
  • |__ product-3(简单或可变产品)

我想使用 product-2 的 ID 获取 product-1 的 ID

php wordpress product woocommerce

4
推荐指数
1
解决办法
2239
查看次数

react-hook-form How can I pass field value to a parent component

I want to get the value of a field inside a react-hook-form component and print it outside the form. The value should be updated onChange. is there a way to use the useWatch outside the form component?

import React from "react";
import ReactDOM from "react-dom";
import { useForm, useWatch } from "react-hook-form";

import "./styles.css";

function Form() {
  const { register, control, handleSubmit } = useForm();
  return (
    <>
      <form onSubmit={handleSubmit((data) => console.log("data", data))}>
        <label>Name:</label>
        <input ref={register} name="name" />
        <p>{useWatch({ control, …
Run Code Online (Sandbox Code Playgroud)

reactjs react-redux react-hooks react-hook-form

3
推荐指数
1
解决办法
9947
查看次数