Giter Club home page Giter Club logo

redux-react-router-problem's Introduction

UPDATE: https://egghead.io/lessons/javascript-redux-using-withrouter-to-inject-the-params-into-connected-components is relavent

FIXME Link/Redirect 问题

一个奇怪的问题,对比本仓库最后两个 commit 。

index.js 此时是这么写的

import App from './components/App'
import { Provider } from 'react-redux'
import store from './redux/store'
import {
  BrowserRouter as Router,
} from 'react-router-dom'

let Kid = (
  <Provider store={store}>
    <Router>
      <App />
    </Router>
  </Provider>
)

那么也就是当 App 被导入的时候, 没有运行,按说这样是不会有问题的,Link/Redirect 都是应该可以正常工作的。

但是,这跟 Redux 有关系。即使是有上面的 Router 加载的顺序问题,如果没有 redux ,一样 Link 都是工作的。但是加上 redux ,Link 点完,url 会变,但是对应组件不运行,页面也不更新。

redux-react-router-problem's People

Contributors

happypeter avatar

Watchers

 avatar James Cloos avatar  avatar

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.