Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme-common): useLocationChange fire un-necessarily twice #6070

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Dec 8, 2021

Motivation

Fix little issue reported by @lex111 here: #5714 (comment)

The useLocationChange always fires again on the very first re-render

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

preview (tried to write tests but ReactRouter makes this quite hard, <StaticRouter> can't update location :s

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Dec 8, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 8, 2021
@netlify
Copy link

netlify bot commented Dec 8, 2021

✔️ [V2]

🔨 Explore the source changes: 8b8ddfd

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61b0ccd5a865670007e5d25a

😎 Browse the preview: https://deploy-preview-6070--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 97
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-6070--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Size Change: +7 B (0%)

Total Size: 657 kB

ℹ️ View Unchanged
Filename Size Change
website/.docusaurus/globalData.json 40.1 kB 0 B
website/build/assets/css/styles.********.css 101 kB 0 B
website/build/assets/js/main.********.js 486 kB +7 B (0%)
website/build/index.html 29.3 kB 0 B

compressed-size-action

@slorber slorber merged commit f5a404b into main Dec 8, 2021
@slorber slorber deleted the slorber/fix-useLocationChange-firing-twice branch December 8, 2021 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants