Skip to content

Commit

Permalink
fix #191
Browse files Browse the repository at this point in the history
  • Loading branch information
Diablohu committed Nov 26, 2019
1 parent 137841e commit bd6f2a7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- 所有注入/插入的 `<script>` 标签现在均会新增 `[data-koot-entry]` 属性
- 特殊 JS 入口 _CLIENT_RUN_FIRST_ 现默认引入 `regenerator-runtime/runtime`
- 现在开发环境下会默认启用 _Service Worker_
- 更新 TS 定义 ([#191](https://github.com/cmux/koot/issues/191))

**koot-boilerplate**

Expand All @@ -40,9 +41,6 @@

- 错误修正
- 新建项目时的“覆盖”模式会删除原有文件的问题 ([#180](https://github.com/cmux/koot/issues/180))
- 更新依赖包 **major** 版本号
- `chalk` -> _^3.0.0_
- `ora` -> _^4.0.3_

## [0.11.15] - 2019-10-15

Expand Down
42 changes: 40 additions & 2 deletions packages/koot/React/component-extender.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import {
ComponentState
} from 'react';
import { Store, Dispatch } from 'redux';
import { MapStateToPropsParam } from 'react-redux';
import {
MapStateToPropsParam,
MapDispatchToPropsNonObject,
MapDispatchToPropsParam,
MergeProps,
Options as ReactReduxOptions
} from 'react-redux';

// ============================================================================

Expand Down Expand Up @@ -45,7 +51,39 @@ class HOC extends Component {}

export function extend<P = {}, S = ComponentState>(options: {
// connect?: Connect;
connect?: MapStateToPropsParam<any, P, any>;
connect?:
| MapStateToPropsParam<any, P, S>
| [null | undefined | MapStateToPropsParam<any, P, S>]
| [
null | undefined | MapStateToPropsParam<any, P, S>,
(
| null
| undefined
| MapDispatchToPropsNonObject<any, P>
| MapDispatchToPropsParam<any, P>
)
]
| [
null | undefined | MapStateToPropsParam<any, P, S>,
(
| null
| undefined
| MapDispatchToPropsNonObject<any, P>
| MapDispatchToPropsParam<any, P>
),
null | undefined | MergeProps<any, any, P, any>
]
| [
null | undefined | MapStateToPropsParam<any, P, S>,
(
| null
| undefined
| MapDispatchToPropsNonObject<any, P>
| MapDispatchToPropsParam<any, P>
),
null | undefined | MergeProps<any, any, P, any>,
null | undefined | ReactReduxOptions<S, any, P>
];
/** 提供页面的 title 和 meta 标签信息 */
pageinfo?: Pageinfo | ExtendPageinfoFunction;
data?: DataFetchFunction | ExtendData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SSR: React.ComponentClass = extend({
ssr: <SSR />
})
class ControledSSR extends React.Component<ExtendedProps> {
render() {
render(): React.ReactNode {
return <div id="koot-test-controled-ssr">Controled SSR</div>;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/projects/standard/src/components/ssr/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Controled from './controled-ssr';
styles: require('./index.module.less')
})
class SSRSamples extends React.Component<ExtendedProps> {
render() {
render(): React.ReactNode {
return (
<div className={this.props.className} id="koot-test-ssr">
<NoSSR />
Expand Down

0 comments on commit bd6f2a7

Please sign in to comment.