14 lines
343 B
TypeScript
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 <></>
|
|
} |