List of hooks #11404
-
Assuming there are some, is the list of available hooks exposed by Docusaurus documented somewhere? I'm trying to find a way to get the document metadata from a custom component, and I assume there should be a hook for that. However, I haven’t found any documentation. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
We have many hooks, but those undoucmented are considered internal and not part of the public API surface. We may try to maintain retrocompatibility on most of them (because some users swizzle our React components), but with no guarantee. Documenting them all and exposing them as public api surface limits our ability to change things without releasing a new major version. See also our release process: https://docusaurus.io/community/release-process This hook may be what you look for, and afaik we don't plan to refactor it in the near future: import {useDoc} from '@docusaurus/plugin-content-docs/client';
const {metadata} = useDoc(); You can find similar hooks exposed in other plugins ( |
Beta Was this translation helpful? Give feedback.
We have many hooks, but those undoucmented are considered internal and not part of the public API surface.
We may try to maintain retrocompatibility on most of them (because some users swizzle our React components), but with no guarantee. Documenting them all and exposing them as public api surface limits our ability to change things without releasing a new major version.
See also our release process: https://docusaurus.io/community/release-process
This hook may be what you look for, and afaik we don't plan to refactor it in the near future:
You can find similar hooks exposed in other plugins (
@do…