2024-05-19 17:43:52 +08:00

14 lines
343 B
TypeScript

import React, {useEffect} from "react";
type DocumentTitleProps = {
children?: string;
text?: string;
}
export const DocumentTitle: React.FC<DocumentTitleProps> = ({children, text}) => {
useEffect(() => {
if (text || children) {
document.title = text || children || '';
}
}, []);
return <></>
}