diff --git a/packages/docusaurus/src/server/plugins/index.ts b/packages/docusaurus/src/server/plugins/index.ts index 32bb7ec44a86..16ee8867c348 100644 --- a/packages/docusaurus/src/server/plugins/index.ts +++ b/packages/docusaurus/src/server/plugins/index.ts @@ -195,9 +195,10 @@ export async function loadPlugins({ // TODO remove this deprecated lifecycle soon // deprecated since alpha-60 + // TODO, 1 user reported usage of this lifecycle! https://github.com/facebook/docusaurus/issues/3918 console.error( chalk.red( - 'plugin routesLoaded lifecycle is deprecated. If you think we should keep this lifecycle, please open a Github issue with your usecase', + 'plugin routesLoaded lifecycle is deprecated. If you think we should keep this lifecycle, please report here: https://github.com/facebook/docusaurus/issues/3918', ), ); diff --git a/website/docs/docusaurus-core.md b/website/docs/docusaurus-core.md index d7933277ac07..50ffe6deb4b1 100644 --- a/website/docs/docusaurus-core.md +++ b/website/docs/docusaurus-core.md @@ -222,7 +222,20 @@ const MyComponent = () => { ### `useBaseUrl` -React hook to automatically prepend `baseUrl` to a string automatically. This is particularly useful if you don't want to hardcode your config's `baseUrl`. We highly recommend you to use this. +React hook to prepend your site `baseUrl` to a string. + +:::caution + +**Don't use it for regular links!** + +The `/baseUrl/` prefix is automatically added to all **absolute paths** by default: + +- Markdown: `[link](/my/path)` will link to `/baseUrl/my/path` +- React: `link` will link to `/baseUrl/my/path` + +::: + +#### Options ```ts type BaseUrlOptions = { @@ -231,41 +244,49 @@ type BaseUrlOptions = { }; ``` -Example usage: +#### Example usage: -```jsx {3,11} +```jsx import React from 'react'; -import Link from '@docusaurus/Link'; import useBaseUrl from '@docusaurus/useBaseUrl'; -const Help = () => { - return ( -
- Learn more about Docusaurus using the{' '} - official documentation -
-