File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
documentation/src/components/DemoSandbox Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import cn from "classnames";
3
3
import { IFiles } from "codesandbox-import-utils/lib/api/define" ;
4
4
5
5
import { CodeBlock } from "components/Code" ;
6
+ import { useTheme } from "components/Theme" ;
6
7
import { RMD_VERSION } from "constants/github" ;
7
8
8
9
import FileNotFound from "./FileNotFound" ;
9
10
10
11
import styles from "./CodePreview.module.scss" ;
11
- import { useTheme } from "components/Theme" ;
12
12
13
13
export interface CodePreviewProps {
14
14
fileName : string ;
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ describe("useAppSize", () => {
43
43
consoleError . mockImplementation ( ) ;
44
44
45
45
expect ( ( ) => render ( < Test /> ) ) . toThrowError (
46
- "Attempted to use the current `AppSizeContext` without mounting the `AppSizeListener` component beforehand."
46
+ "Unable to get the current `AppSize` from `react-md` because the `AppSizeListener` " +
47
+ "could not be found when using the `useAppSize` hook. To fix this error, either " +
48
+ "initialize the `AppSizeListener` component from `@react-md/utils` or the " +
49
+ "`Configuration` component from `@react-md/layout` near the root of your app."
47
50
) ;
48
51
} ) ;
49
52
} ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ export default function useAppSize(): AppSize {
20
20
const { __initialized, ...context } = useContext ( AppSizeContext ) ;
21
21
if ( ! __initialized ) {
22
22
throw new Error (
23
- "Attempted to use the current `AppSizeContext` without mounting the `AppSizeListener` component beforehand."
23
+ "Unable to get the current `AppSize` from `react-md` because the `AppSizeListener` " +
24
+ "could not be found when using the `useAppSize` hook. To fix this error, either " +
25
+ "initialize the `AppSizeListener` component from `@react-md/utils` or the " +
26
+ "`Configuration` component from `@react-md/layout` near the root of your app."
24
27
) ;
25
28
}
26
29
You can’t perform that action at this time.
0 commit comments