Skip to content

Commit a9955bb

Browse files
committed
Upgrade dependencies, handle peer dependencies
1 parent b5f876b commit a9955bb

File tree

6 files changed

+464
-290
lines changed

6 files changed

+464
-290
lines changed

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
"build": "yarn ts:build",
1818
"prepublishOnly": "yarn build"
1919
},
20-
"dependencies": {
21-
"react": "^16.11.0",
20+
"peerDependencies": {
21+
"@types/react": "^16.9.17",
22+
"@types/react-dom": "^16.9.4",
23+
"@types/react-router-dom": "^5.1.3",
24+
"react": "^16.12.0",
2225
"react-router-dom": "^5.1.2"
2326
},
2427
"devDependencies": {
25-
"@types/react": "^16.9.9",
26-
"@types/react-dom": "^16.9.2",
27-
"@types/react-router-dom": "^5.1.0",
28-
"@typescript-eslint/eslint-plugin": "^2.5.0",
29-
"@typescript-eslint/parser": "^2.5.0",
30-
"eslint": "^6.5.1",
28+
"@typescript-eslint/eslint-plugin": "^2.15.0",
29+
"@typescript-eslint/parser": "^2.15.0",
30+
"eslint": "^6.8.0",
3131
"eslint-config-airbnb": "^18.0.1",
32-
"eslint-plugin-import": "^2.18.2",
32+
"eslint-plugin-import": "^2.20.0",
3333
"eslint-plugin-jsx-a11y": "^6.2.3",
34-
"eslint-plugin-react": "^7.16.0",
35-
"http-server": "^0.11.1",
36-
"react-dom": "^16.11.0",
34+
"eslint-plugin-react": "^7.17.0",
35+
"http-server": "^0.12.1",
36+
"react-dom": "^16.12.0",
3737
"ts-loader": "^6.2.1",
38-
"typescript": "^3.6.4",
39-
"webpack": "^4.41.2",
40-
"webpack-cli": "^3.3.9"
38+
"typescript": "^3.7.4",
39+
"webpack": "^4.41.5",
40+
"webpack-cli": "^3.3.10"
4141
}
4242
}

src/PrivateRoute.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const PrivateRoute: FunctionComponent<Props> = ({
1010
isAuthorized,
1111
onUnauthorized,
1212
...props
13-
}): ReactElement | null => {
13+
}): ReactElement<any> | null => {
1414
if (!isAuthorized) {
1515
if (typeof onUnauthorized === "function") {
1616
onUnauthorized(props);

src/Walls.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ interface Props {
1919
routes: RouteProps[];
2020
isAuthorized?: boolean;
2121
onUnauthorized?: (props: any) => void;
22-
children?: ReactElement;
22+
children?: ReactElement<any>;
2323
}
2424

2525
const Walls: FunctionComponent<Props> = ({
2626
routes,
2727
isAuthorized = false,
2828
onUnauthorized,
2929
children,
30-
}): ReactElement => {
30+
}): ReactElement<any> => {
3131
const PrivateRouteAny = PrivateRoute as any;
3232

3333
return (
@@ -37,7 +37,7 @@ const Walls: FunctionComponent<Props> = ({
3737

3838
<Switch>
3939
{routes.map(
40-
(route: RouteProps): ReactElement => {
40+
(route: RouteProps): ReactElement<any> => {
4141
const { private: privateRoute, id, ...props } = route;
4242
const key = `route-${id || (Math.random() * 10000).toFixed(4)}`;
4343

src/__tests__/visual/Container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Walls from "../../../index";
55

66
import routes from "./routes";
77

8-
const Container = (): ReactElement => (
8+
const Container = (): ReactElement<any> => (
99
<Walls routes={routes}>
1010
<nav>
1111
<ul>

src/__tests__/visual/routes.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ export default [{
44
private: false,
55
exact: true,
66
path: "/",
7-
render: (): ReactElement => (
7+
render: (): ReactElement<any> => (
88
<p>Home</p>
99
),
1010
}, {
1111
private: false,
1212
exact: true,
1313
path: "/foo",
14-
render: (): ReactElement => (
14+
render: (): ReactElement<any> => (
1515
<p>Foo</p>
1616
),
1717
}, {
1818
private: true,
1919
exact: true,
2020
path: "/bar",
21-
render: (): ReactElement => (
21+
render: (): ReactElement<any> => (
2222
<p>Bar (Private)</p>
2323
),
2424
}];

0 commit comments

Comments
 (0)