📅  最后修改于: 2022-03-11 15:02:44.894000             🧑  作者: Mango
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);