Using React functional components and Typescript, would there be any difference between using the useHistory hook vs RouteComponentProps (react router v5.1)?
Example using RouteComponentProps :
import { RouteComponentProps } from 'react-router-dom';
interface PropsType extends RouteComponentProps {
text: string;
}
const MyFunctionalComponent = ({
text,
history
}: PropsType) => {
};
Example using useHistory:
import { useHistory } from 'react-router-dom';
interface PropsType {
text: string;
}
const MyFunctionalComponent = ({
text
}: PropsType) => {
const history = useHistory();
};