umijs / qiankun

📦 🚀 Blazing fast, simple and complete solution for micro frontends.
https://qiankun.umijs.org
MIT License
15.72k stars 2k forks source link

react-router中location.query信息丢失 #2104

Open Yan1 opened 2 years ago

Yan1 commented 2 years ago

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"
15982153332 commented 2 years ago

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

Yan1 commented 2 years ago

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

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