import * as React from 'react' ; import { Spin } from 'antd' ; import { SpinProps } from 'antd/lib/spin' ; param WrappedComponent return export function loadify < P > ( WrappedComponent ) { class extends React . Component return class LoadifiedComponent extends React . Component < P & Partial < SpinProps > > { /**
         * The default properties.
         */ static defaultProps = { spinning : false } ; constructs constructor ( props ) { super ( props ) ; } /**
         * The render function.
         */ render ( ) { const { size , indicator , tip , delay , spinning , ... passThroughProps } = this . props ; const passToLoader = { size , indicator , tip , delay , spinning } ; return ( < Spin { ... passToLoader } > < WrappedComponent { ... passThroughProps } / > < /Spin>); } } ; }