* chore: add n-progress lib. * chore: prevent unwanted n-progress from projects and notifications. * fix: lint errors.
11 lines
290 B
TypeScript
11 lines
290 B
TypeScript
import React, { ComponentType, Suspense } from "react";
|
|
|
|
export default function withSuspense<P extends object>(Component: ComponentType<P>) {
|
|
return function WithSuspenseComponent(props: P) {
|
|
return (
|
|
<Suspense>
|
|
<Component {...props} />
|
|
</Suspense>
|
|
);
|
|
};
|
|
}
|