Skip to content

docs(v2): do not recommend using useBaseUrl() hook in most cases#4126

Merged
slorber merged 2 commits into
masterfrom
slorber/doc-useBaseUrl
Jan 29, 2021
Merged

docs(v2): do not recommend using useBaseUrl() hook in most cases#4126
slorber merged 2 commits into
masterfrom
slorber/doc-useBaseUrl

Conversation

@slorber

@slorber slorber commented Jan 29, 2021

Copy link
Copy Markdown
Collaborator

Motivation

The useBaseUrl hook should not be used very often, because:

  • the base url is added to all React/Markdown absolute links by default
  • webpack asset loaders that handle the baseurl automatically

The use-cases for useBaseUrl are now quite limited (but we still need it, mostly to implement the themes)

Related: #4119

@slorber slorber added the pr: documentation This PR works on the website or other text documents in the repo. label Jan 29, 2021
@slorber slorber requested a review from lex111 as a code owner January 29, 2021 17:53
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jan 29, 2021
@netlify

netlify Bot commented Jan 29, 2021

Copy link
Copy Markdown

[V1] Deploy preview success

Built with commit c1af0e6

https://deploy-preview-4126--docusaurus-1.netlify.app

@github-actions

Copy link
Copy Markdown

Size Change: -6 B (0%)

Total Size: 28.9 kB

ℹ️ View Unchanged
Filename Size Change
website/build/blog/2017/12/14/introducing-docusaurus/index.html 21.8 kB -4 B (0%)
website/build/docs/introduction/index.html 180 B 0 B
website/build/index.html 6.92 kB -2 B (0%)

compressed-size-action

@netlify

netlify Bot commented Jan 29, 2021

Copy link
Copy Markdown

Deploy preview for docusaurus-2 ready!

Built with commit c1af0e6

https://deploy-preview-4126--docusaurus-2.netlify.app

@github-actions

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 88
🟢 Accessibility 99
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

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

@slorber slorber merged commit 140bfbf into master Jan 29, 2021
@lex111 lex111 added this to the v2.0.0-alpha.71 milestone Mar 1, 2021
@slorber slorber deleted the slorber/doc-useBaseUrl branch August 17, 2021 17:50
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
…ebook#4126)

* doc: suggest not using useBaseUrl most of the time

* doc: suggest not using useBaseUrl most of the time
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: documentation This PR works on the website or other text documents in the repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants