请问下,从A页面跳转到B页面,用state传值,在B页面刷新后 state就为空了,怎么解决?
A页面 传值代码
render: (text, record, index) => {
const path = {
pathname:'/goods-details',
state: {
outerItemId: record.outerItemId,
},
}
return <Link to={path}>{text}</Link>;
},
to: object
An object that can have any of the following properties:
pathname: A string representing the path to link to.
search: A string represenation of query parameters.
hash: A hash to put in the URL, e.g. #a-hash.
state: State to persist to the location.
https://reacttraining.com/rea...