Skip to content

Commit fecadb5

Browse files
committed
rewrite assignments for Route.propTypes
1 parent 92fae12 commit fecadb5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/routes.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import PropTypes from 'prop-types';
12
import React, { useEffect } from 'react';
23
import { useDispatch } from 'react-redux';
34
import { Route as RouterRoute, Switch } from 'react-router-dom';
@@ -47,7 +48,10 @@ const withParams = (Component) => (props) => (
4748
const Route = ({ component, ...props }) => (
4849
<RouterRoute component={withParams(component)} {...props} />
4950
);
50-
Route.propTypes = { ...RouterRoute.propTypes };
51+
Route.propTypes = {
52+
...RouterRoute.propTypes,
53+
component: PropTypes.elementType.isRequired
54+
};
5155

5256
const routes = (
5357
<Switch>

0 commit comments

Comments
 (0)