mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
docs(v2): add useThemeContext note (#2934)
* docs: add note to useThemeContext api docs * Update example usage
This commit is contained in:
parent
c341f457fb
commit
d365b7424b
1 changed files with 16 additions and 0 deletions
|
@ -94,6 +94,22 @@ const Example = () => {
|
|||
};
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
The component calling `useThemeContext` must be a child of the `Layout` component.
|
||||
|
||||
```jsx
|
||||
function ExamplePage() {
|
||||
return (
|
||||
<Layout>
|
||||
<Example />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## Navbar
|
||||
|
||||
### Navbar title & logo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue