【发布时间】:2022-01-04 06:24:48
【问题描述】:
我想在用户单击以响应的 handleClick 函数时呈现 infoPage.js。感谢帮助?
infoPage.js
import React from 'react'
export default function infoPage() {
return (
<div>
<h1> this is info components</h1>
</div>
)
}
App.js:
<button className="btn btn-primary" onClick={handleClick}>{value.title}</button>
功能:
const handleClick = () => {
const url = infoPage;
window.open(url, '_blank');
}
【问题讨论】:
-
你能详细解释一下你的问题吗!
-
我想在用户单击到应呈现 infoPage.js 的 handleClick 函数时呈现反应组件
-
你想在点击右键时在新窗口中打开
infoPage? -
可以设置infoPage的路由吗?
-
请将工作代码转发给我。感谢您的帮助
标签: reactjs react-redux react-hooks react-router