Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-router-redux 4.x 中的Object.defineProperty问题 #26

Closed
codering opened this issue May 6, 2016 · 4 comments

Comments

@codering
Copy link

commented May 6, 2016

你好,我看到react-router-redux 4.x 中发布的代码部分如下:

Object.defineProperty(exports, 'LOCATION_CHANGE', {
    enumerable: true,
    get: function get() {
      return _reducer.LOCATION_CHANGE;
    }
  });
  Object.defineProperty(exports, 'routerReducer', {
    enumerable: true,
    get: function get() {
      return _reducer.routerReducer;
    }
  });
....

这样的代码 哪怕用了polyfill 也没法兼容IE8了吧 ?

@codering

This comment has been minimized.

Copy link
Author

commented May 6, 2016

哈,看到官方的issue了, 等待修复中 reactjs/react-router-redux#382

@dyf2015

This comment has been minimized.

Copy link

commented Jun 12, 2016

@codering 官方修复了吗?

@codering

This comment has been minimized.

Copy link
Author

commented Jun 13, 2016

@dyf2015 我现在的做法是单独引用, 比如

import syncHistoryWithStore  from 'react-router-redux/lib/sync'
import {routerReducer} from 'react-router-redux/lib/reducer'

你可以看下的源码index.js https://github.com/reactjs/react-router-redux/blob/master/src/index.js

export syncHistoryWithStore from './sync'
export { LOCATION_CHANGE, routerReducer } from './reducer'

export {
  CALL_HISTORY_METHOD,
  push, replace, go, goBack, goForward,
  routerActions
} from './actions'
export routerMiddleware from './middleware'

其实就只有index.js用到export from 的语法, 按需单独引用就ok的,注意发布到npm时是在lib目录下。

@dyf2015

This comment has been minimized.

Copy link

commented Jun 13, 2016

感谢

发自我的 iPhone

在 2016年6月13日,09:54,Justin <notifications@github.commailto:notifications@github.com> 写道:

@dyf2015https://github.com/dyf2015 我现在的做法是单独引用, 比如

import syncHistoryWithStore from 'react-router-redux/lib/sync'
import {routerReducer} from 'react-router-redux/lib/reducer'

你可用看下的源码index.js https://github.com/reactjs/react-router-redux/blob/master/src/index.js

export syncHistoryWithStore from './sync'
export { LOCATION_CHANGE, routerReducer } from './reducer'

export {
CALL_HISTORY_METHOD,
push, replace, go, goBack, goForward,
routerActions
} from './actions'
export routerMiddleware from './middleware'

按需单独引用就ok的。


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com//issues/26#issuecomment-225474727, or mute the threadhttps://github.com/notifications/unsubscribe/APjvyS2Fjc_WNRt7vv2GtwhCy0F6NyV2ks5qLLg7gaJpZM4IYvad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.