如何使用React挂钩并获取查询字符串值?
与我使用的反应班: const id = this.props.match.params.id;
import { useParams } from "react-router-dom";
在组件中:
const { id } = useParams();
https://reacttraining.com/react-router/web/api/Hooks/useparams
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句