📜  反应钩子形式示例堆栈溢出 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:51.153000             🧑  作者: Mango

代码示例1
import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from "react-redux";
import useForm from 'react-hook-form';

function SampleForm() {
  const { register, handleSubmit } = useForm();
  const onSubmit = data => {
    alert(JSON.stringify(data));
  };

  return (
    
); } class Sample extends Component { constructor(props) { super(props); } render() { return ; } } export default connect()(Sample); const rootElement = document.getElementById('root'); ReactDOM.render(, rootElement);