docs(v2): add useThemeContext note (#2934)

* docs: add note to useThemeContext api docs

* Update example usage
This commit is contained in:
Drew Alexander 2020-06-15 18:39:17 +08:00 committed by GitHub
parent c341f457fb
commit d365b7424b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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