facebook / facebook/docusaurus
onRouteDidUpdate does not see new Head metadata
- Ngôn ngữ chính
- TypeScript
- Star
- 66.2k
- Fork
- 10k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 52
Mô tả
### Have you read the Contributing Guidelines on issues?
- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).
### Prerequisites
- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).
### Description
When navigating between routes, the `onRouteDidUpdate` client module lifecycle does not see the newly updated Head / Helmet metadata
This leads to annoying usage of setTimeout in userland plugins.
As commented in https://github.com/facebook/docusaurus/issues/3399#issuecomment-1300174763, I believe this is due to `react-helmet-async` using `` by default (to confirm).
We should study the impact of turning `defer={false}`: performance or anything else
### Reproducible demo
_No response_
### Steps to reproduce
Take a deploy preview, navigate to another page, and look at console logs.
https://deploy-preview-8275--docusaurus-2.netlify.app/

### Expected behavior
title/description (and other metadata) should rather be correct
### Actual behavior
title/description is incorrect
### Your environment
_No response_
### Self-service
- [X] I'd be willing to fix this bug myself.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.