-
|
Hello, Is there an API to get the active instance's context (plugin ID, version, and so on) in a multi-instance setup? I looked up at the Docusaurus Client API page, but it appears that there is no such feature regarding the instance, although there seems to be one for I18n ( I'd greatly appreciate your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
We have an undocumented core React hook for that import useRouteContext from '@docusaurus/useRouteContext';
const routeContext = useRouteContext();
routeContext.plugin.name;
routeContext.plugin.id;It's not documented so technically not part of the public API surface yet but I doubt we remove it. Maybe avoid using this in a plugin's code, but if it's your own site that's fine. |
Beta Was this translation helpful? Give feedback.
This hook is generic/core.
If your React component is only called inside docs pages, you can use these ones: