import React , { ComponentType , Suspense } from 'react' ; import { Loader } from 'components' ; import './withSuspense.scss' ; export default function withSuspense < P > ( WrappedComponent ) { return ( props ) => { return ( < Suspense fallback = { < Loader className = "WithSuspense__loader" / > } > < WrappedComponent { ... props } / > < /Suspense>); } ; }