Overload 1 of 2, '(props: RouterProps | Readonly<RouterProps>): Router', gave the following error. Property 'history' is missing in type '{ children: Element; }' but required in type 'Readonly<RouterProps>'. code example

Example: reach router path typescript error

import React, { FunctionComponent } from "react";
import { RouteComponentProps } from "@reach/router";

type Props = { component: FunctionComponent } & RouteComponentProps;

const Route: FunctionComponent<Props> = ({ component: Component, ...rest }) => (
  <Component {...rest} />
);

export default Route;