Skip to content

Commit f49e39f

Browse files
committed
Updated ts
1 parent e59dddb commit f49e39f

File tree

6 files changed

+44
-29
lines changed

6 files changed

+44
-29
lines changed

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-async",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"author": {
55
"name": "Oleg Martynov",
66
"email": "[email protected]"
@@ -26,7 +26,10 @@
2626
"tsc": "tsc"
2727
},
2828
"devDependencies": {
29-
"typescript": "2.2.1"
29+
"@types/es6-promise": "3.x.x",
30+
"@types/node": "9.x.x",
31+
"@types/react": "16.x.x",
32+
"typescript": "2.x.x"
3033
},
3134
"peerDependencies": {
3235
"react": "16.x.x"

src/placeholder.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ export default class Placeholder extends React.Component<Props, State> {
1919
static contextTypes = {
2020
router: PropTypes.object.isRequired
2121
};
22-
constructor({ Component, componentProps }) {
23-
super();
22+
constructor(props) {
23+
super(props);
24+
2425
this.state = {
25-
Component,
26-
componentProps
26+
Component : props.Component,
27+
componentProps: props.componentProps
2728
};
2829
}
2930
componentDidMount() {

src/router.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export interface initResult {
4848
status?: any,
4949
routerProps?: any,
5050
componentProps?: any,
51-
callback?: any
51+
callback?: any,
52+
error?: any
5253
}
5354
export interface childContext {
5455
router: PropTypes.object
@@ -60,18 +61,19 @@ export default class Router extends React.Component<Props, State> {
6061
path: string;
6162
location: any;
6263
private subscriber: any;
63-
constructor({ Component, componentProps, router, path, location, errors }) {
64-
super();
64+
constructor(props) {
65+
super(props);
66+
6567
this.state = {
66-
Component,
67-
componentProps,
68-
path,
69-
location,
70-
error: componentProps.router.error
68+
Component : props.Component,
69+
componentProps: props.componentProps,
70+
path : props.path,
71+
location : props.location,
72+
error : props.componentProps.router.error
7173
};
7274

73-
this.router = router;
74-
this.errors = errors;
75+
this.router = props.router;
76+
this.errors = props.errors;
7577
this.subscriber = null;
7678
}
7779
static async init(opts: initParams): Promise<initResult> {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2015",
44
"module": "commonjs",
55
"outDir": "./lib",
66
"declaration": true,

typings.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

yarn.lock

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
# yarn lockfile v1
33

44

5+
6+
version "3.3.0"
7+
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-3.3.0.tgz#61b55e554fd807b563f158a7986ee53d3a5a5a9d"
8+
dependencies:
9+
es6-promise "*"
10+
11+
12+
version "9.4.6"
13+
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e"
14+
15+
16+
version "16.0.38"
17+
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.38.tgz#76617433ea10274505f60bb86eddfdd0476ffdc2"
18+
519
asap@~2.0.3:
620
version "2.0.6"
721
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
@@ -16,6 +30,10 @@ encoding@^0.1.11:
1630
dependencies:
1731
iconv-lite "~0.4.13"
1832

33+
es6-promise@*:
34+
version "4.2.4"
35+
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
36+
1937
fbjs@^0.8.16:
2038
version "0.8.16"
2139
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db"
@@ -110,9 +128,9 @@ strict-uri-encode@^1.0.0:
110128
version "1.1.0"
111129
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
112130

113-
typescript@2.2.1:
114-
version "2.2.1"
115-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.1.tgz#4862b662b988a4c8ff691cc7969622d24db76ae9"
131+
typescript@2.x.x:
132+
version "2.7.2"
133+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
116134

117135
ua-parser-js@^0.7.9:
118136
version "0.7.17"

0 commit comments

Comments
 (0)