qiankun icon indicating copy to clipboard operation
qiankun copied to clipboard

react-router中location.query信息丢失

Open Yan1 opened this issue 2 years ago • 2 comments

What happens?

在主应用或子应用中,通过 <Link to={{pathname: xxx, query: xxx}}>to About</Link>进入的页面中,location.query 为空

Mini Showcase Repository(REQUIRED)

Provide a mini GitHub repository which can reproduce the issue.

https://codesandbox.io/s/determined-antonelli-xb48oj?file=/src/index.js

How To Reproduce

  1. 从首页中to about进去about页面,控制台打印的location无query字段; image

  2. 将index.js中start(); 注释掉,再重复第一步操作,location有query字段 image

Context

    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-scripts": "4.0.0",
    "react-router-dom": "^5.3.0",
    "qiankun": "^2.7.0"

Yan1 avatar May 24 '22 06:05 Yan1

你好,请问找到原因了吗,我也遇到这个问题了

15982153332 avatar Jul 20 '22 06:07 15982153332

你好,请问找到原因了吗,我也遇到这个问题了

没有呀,只能暂时不用 location.query 传信息

Yan1 avatar Jul 30 '22 10:07 Yan1