【发布时间】:2021-11-05 05:47:03
【问题描述】:
如何将 Link 组件的“ischecked”状态传递给下面的输入? 我的目标是单击其他组件上的按钮,将输入框设置为 true。
<Link
to={{pathname: "/Module1",
state: {
ischecked: false,
},
}}
className={styles.menuCard}>
<h2>Introduction →</h2>
<p>Lesson 1</p>
<input className={styles.checkbox} type="checkbox"
checked={ischecked} /> <<--cant access? how to access?
</Link>
【问题讨论】:
标签: reactjs input react-router state react-link