如何从prop.location.state中获取数据?

问题描述 投票:0回答:1

我尝试通过历史记录推送方式发送数据。enter image description here

然后我尝试获取我发送的id的值。enter image description here

问题是当第一次渲染组件时,我得到了undefined的值。然后,当我单击浏览器上的上一个按钮时,便得到了该值。为什么会发生??????

reactjs react-router react-router-v4 react-router-dom browser-history
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.