fix(website): ensure feedback widget renders with correct theme#11224
fix(website): ensure feedback widget renders with correct theme#11224slorber merged 3 commits intofacebook:mainfrom p-m-p:main
Conversation
If a user lands on the feature request community page with the theme set to dark the canny widget is rendered twice, first light and then dark. The first call with the light theme takes effect as the widget has not yet loaded and the widget shows in light theme. Adding a small delay prevents the first render with the wrong theme.
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Hey thanks for noticing this little bug I'm not a fan of setTimeout with magic values, so I changed the fix for a better implementation. Although both solutions work and fix the issue, the root source of the error is due to On first render, it always returns the "default" theme we use during SSG to avoid React hydration mismatches. And the TLDR, during both initial load (hydration) and navigation, the We should find a way to fix the root cause, but it likely requires a breaking change to the publicly documented |
If a user lands on the feature request community page with the theme set to dark the canny widget is rendered twice, first light and then dark. The first call with the light theme takes effect as the widget has not yet loaded and the widget shows in light theme. Adding a small delay prevents the first render with the wrong theme.
Pre-flight checklist
Test links
Deploy preview: https://deploy-preview-11224--docusaurus-2.netlify.app/