All files / hooks/use-media-query/src types.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                                         
/**
 * Options for the useMediaQuery hook.
 */
export interface UseMediaQueryOptions {
  /**
   * Value returned on the server and, when `initializeWithValue` is `false`,
   * on the first client render — before the media query can be evaluated.
   * Choose this to match your SSR output and avoid hydration mismatches.
   * @default false
   */
  defaultValue?: boolean;
 
  /**
   * Whether to read the real match synchronously on the first client render.
   * Set to `false` for SSR to guarantee the first client render matches the
   * server (`defaultValue`), then update in an effect.
   * @default true
   */
  initializeWithValue?: boolean;
}