Fixed no longer implicit children prop in FunctionalComponent type

This commit is contained in:
Alejandro Celaya
2022-04-24 10:39:11 +02:00
parent d5b1dc5bff
commit 271b19a4ec
28 changed files with 86 additions and 80 deletions

View File

@@ -1,4 +1,6 @@
import { FC } from 'react';
import { FC, PropsWithChildren } from 'react';
import './NoMenuLayout.scss';
export const NoMenuLayout: FC = ({ children }) => <div className="no-menu-wrapper container-xl">{children}</div>;
export const NoMenuLayout: FC<PropsWithChildren<unknown>> = ({ children }) => (
<div className="no-menu-wrapper container-xl">{children}</div>
);

View File

@@ -1,10 +1,8 @@
import { FC } from 'react';
import { FC, PropsWithChildren } from 'react';
import { Link } from 'react-router-dom';
import { SimpleCard } from '../utils/SimpleCard';
interface NotFoundProps {
to?: string;
}
type NotFoundProps = PropsWithChildren<{ to?: string }>;
const NotFound: FC<NotFoundProps> = ({ to = '/', children = 'Home' }) => (
<div className="home">

View File

@@ -1,7 +1,7 @@
import { FC, useEffect } from 'react';
import { FC, PropsWithChildren, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
const ScrollToTop = (): FC => ({ children }) => {
const ScrollToTop = (): FC<PropsWithChildren<unknown>> => ({ children }) => {
const location = useLocation();
useEffect(() => {