【问题标题】:React js and Spring boot URL ParametersReact js 和 Spring Boot URL 参数
【发布时间】:2023-04-11 10:00:01
【问题描述】:

你好,我需要在我的参数中获取id,但我得到了错误

这是我的代码:

<td>  <Link to="/updateregion/${listregion.id}"></Link>  </td>

请问我应该怎么做

这是导航代码:

<Route path="/updateregion/:id" component={updateregion}/>

【问题讨论】:

  • 获取id的代码在哪里?

标签: reactjs spring-boot axios react-router-v4


【解决方案1】:

这是你需要的吗?

// updaterection.jsx
import React from 'react'

const updateregion = props => {
  const id = props.match.params.id
  // return JSX
}

export default updateregion

【讨论】:

  • nn 我需要在 updateregion {listeregion.id} 中发送 id
猜你喜欢
  • 1970-01-01
  • 2020-07-05
  • 2018-10-07
  • 1970-01-01
  • 1970-01-01
  • 2021-02-01
  • 1970-01-01
  • 2021-08-14
  • 1970-01-01
相关资源
最近更新 更多