Coder Social home page Coder Social logo

Comments (4)

zhangyuang avatar zhangyuang commented on June 17, 2024

原因

dva 的routerRedux实际引用的是react-router-redux这个库,观察这个库源码可知,这个库中的history来源是connectedRouter这个组件的props.history,故如果不使用connectedRouter将入口组件包一层并且传入history,在react-router-redux将无法获取到正确的history

解决方式

from egg-react-ssr.

williamnie avatar williamnie commented on June 17, 2024

您好,当我按照图片这种方式修改以后,发现了一个问题,首次打开页面,会造成render两次,貌似是history变化了,导致刷新了,您对这个有什么好的建议或者解决方案么?@zhangyuang

from egg-react-ssr.

zhangyuang avatar zhangyuang commented on June 17, 2024

@williamnie 新开一个issue给复现仓库。个人建议老老实实用history.push pop这些api最好。图片贴的方法只是给想用routerRedux的人用,我是不建议这么写的

from egg-react-ssr.

williamnie avatar williamnie commented on June 17, 2024

@zhangyuang 已经提了新的issue #166

from egg-react-ssr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.