🐛(frontend) meta title rerender issue

The meta title is not displayed when we come back to
a page from the dynamic router. The code seems to
compute to quickly so we need to add a delay to the
meta title computation.
This commit is contained in:
Anthony LC
2024-09-09 17:35:17 +02:00
committed by Anthony LC
parent d249ed0c71
commit b9046a2d9b

View File

@@ -36,7 +36,9 @@ const DocPage = ({ id }: DocProps) => {
useEffect(() => {
if (doc?.title) {
document.title = `${doc.title} - Docs`;
setTimeout(() => {
document.title = `${doc.title} - Docs`;
}, 100);
}
}, [doc?.title]);