From 5bcc9b41e59bf7215abf395ea899cdbc2d06db9a Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 3 Feb 2020 14:51:10 +0300 Subject: feat: use React.FC syntax This approach is better because it allows to use destructuring right in a function declaration without explicitly defining children propety in PropTypes --- src/lib/components/Window/WindowSurface.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/lib/components/Window/WindowSurface.tsx') diff --git a/src/lib/components/Window/WindowSurface.tsx b/src/lib/components/Window/WindowSurface.tsx index aaaa984..701a767 100644 --- a/src/lib/components/Window/WindowSurface.tsx +++ b/src/lib/components/Window/WindowSurface.tsx @@ -8,7 +8,6 @@ import { SurfaceSize, SurfacePosition } from './types'; interface PropTypes { size: SurfaceSize; position: SurfacePosition; - children?: any; } @@ -27,9 +26,8 @@ const useStyles = makeStyles((theme: any) => ({ })); -const WindowSurface = (props: PropTypes) => { +const WindowSurface: React.FC = ({ size, position, children }) => { const classes = useStyles(); - const { size, position, children } = props; return (