File tree Expand file tree Collapse file tree
documentation/src/components/DemoSandbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ import cn from "classnames";
33import { IFiles } from "codesandbox-import-utils/lib/api/define" ;
44
55import { CodeBlock } from "components/Code" ;
6+ import { useTheme } from "components/Theme" ;
67import { RMD_VERSION } from "constants/github" ;
78
89import FileNotFound from "./FileNotFound" ;
910
1011import styles from "./CodePreview.module.scss" ;
11- import { useTheme } from "components/Theme" ;
1212
1313export interface CodePreviewProps {
1414 fileName : string ;
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ describe("useAppSize", () => {
4343 consoleError . mockImplementation ( ) ;
4444
4545 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."
4750 ) ;
4851 } ) ;
4952} ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ export default function useAppSize(): AppSize {
2020 const { __initialized, ...context } = useContext ( AppSizeContext ) ;
2121 if ( ! __initialized ) {
2222 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."
2427 ) ;
2528 }
2629
You can’t perform that action at this time.
0 commit comments