import { FunctionComponent } from "preact"; import { useEffect } from "preact/hooks"; export const withTitle =
(title: string, WrappedComponent: FunctionComponent
): FunctionComponent
=> { const ComponentWithTitle: FunctionComponent
= (props) => {
useEffect(() => {
document.title = title;
}, []);
return