From d365b7424b99109665487782a54ab8f6141719fa Mon Sep 17 00:00:00 2001 From: Drew Alexander Date: Mon, 15 Jun 2020 18:39:17 +0800 Subject: [PATCH] docs(v2): add useThemeContext note (#2934) * docs: add note to useThemeContext api docs * Update example usage --- website/docs/theme-classic.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/website/docs/theme-classic.md b/website/docs/theme-classic.md index 9d3cc36ccb..2f7f41340e 100644 --- a/website/docs/theme-classic.md +++ b/website/docs/theme-classic.md @@ -94,6 +94,22 @@ const Example = () => { }; ``` +:::note + +The component calling `useThemeContext` must be a child of the `Layout` component. + +```jsx +function ExamplePage() { + return ( + + + + ); +} +``` + +::: + ## Navbar ### Navbar title & logo