Skip to content

Commit

Permalink
feat: support add extraProps to router, Close #303
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Dec 5, 2016
1 parent 7d0512f commit 8f8c95d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/createDva.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ export default function createDva(createOpts) {
// Helpers

function getProvider(store, app, router) {
return () => (
return (extraProps) => (
<Provider store={store}>
{ router({ app, history: app._history, }) }
{ router({ app, history: app._history, ...extraProps }) }
</Provider>
);
}
Expand Down

4 comments on commit 8f8c95d

@HengCC
Copy link

@HengCC HengCC commented on 8f8c95d Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么我更新不下来呢? 我修改了 package.json 为 latest. 清除了 npm cache

可是最后下载下来,代码依旧是

 function getProvider(store, app, router) {
      return () => (
        <Provider store={store}>
          { router({ app, history: app._history, }) }
        </Provider>
      );
    }

@sorrycc
Copy link
Member Author

@sorrycc sorrycc commented on 8f8c95d Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dva 的版本是 1.2.0-beta 。详见 sorrycc/dva-boilerplate-isomorphic@149e9a7

@HengCC
Copy link

@HengCC HengCC commented on 8f8c95d Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

按照这个是更新成功了. 不知 dva-cli new 出来的项目是否还是1.1的版本.
之前就是按照这个 ssr 的项目, 也配置了一次1.2的没更新下来.所以才设了 latest, 但是这次是成功了,可能是我的配置问题. 我打算重新测试下这个 ssr 的项目.在原有的 user_board 基础上, 非常感谢.

@sorrycc
Copy link
Member Author

@sorrycc sorrycc commented on 8f8c95d Dec 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.2.0 没有正式发,正式发了之后 dva-cli new 会自动用最新版安装。

Please sign in to comment.