如何使用React Hook 并获取查询字符串值?
与我使用的 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
关于reactjs - React Hooks-如何从查询字符串获取参数值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62426998/