【发布时间】:2020-07-07 05:30:22
【问题描述】:
我正在使用 react-router 库进行导航,并使用 history.push() 来导航 onClick。当用户点击一行时,他们将被导航到“otherPage”。在“otherPage”中,我想使用变量“id”。如何传递这个变量?
function handleRowClick(id: number): void {
// navigates user to another page
history.push('/otherPage');
}
【问题讨论】:
-
请不要在标题中加上“标签”,这是标签的用途。
标签: reactjs typescript react-router react-hooks tsx