reactjs - 如何在 React 中传递这样的 URL 参数?
问题描述
http://localhost:8080/?companyKey=eefef-edd-dd-ddf
我想通过 URL 在我的反应项目中传递公司密钥
我用了这个方法
<Route exact path="/?companyKey=key"component={CompanySelectorFromKey} />
该方法不起作用
解决方案
<Route path='/edit/:id' component={Edit} />
在编辑组件中,您会收到此 ID
let id = props.match.params.id;
推荐阅读
- excel-formula - 索引和匹配多个结果并连接
- kubernetes - 从 Kubernetes 中删除 configmap 本身
- c# - 从 XML 文件导入到 MS Project 后,什么会导致设置不正确的日期?
- python - 我可以使用 selenium+python 获得多选选项吗
- python - [Tensorflow 1.x] 使用 BERT 的多标签分类,无效参数:断言失败:[`predictions` 包含负值]
- css - CSS动画随着旋转来回移动
- ios - 有人可以帮我解决这个警告:冗余一致性约束'T':'ReusableView'吗?我到处搜索,但没有发现任何帮助
- c# - 使用自定义 API 进行外部登录
- postcss - 嵌套的 @import CSS 语句未使用 rollup-plugin-postcss 进行汇总
- c# - 如何使用多个条件(可能为空)从数据库中优雅地选择行?