From f916a0029f6d8b28807f0ed6d33f005bf8993507 Mon Sep 17 00:00:00 2001 From: Sergey Melnikov Date: Tue, 16 Jul 2024 18:09:42 -0400 Subject: [PATCH] Revert "Make useMedia options an optional param" This reverts commit 0fc2d5448681c1ae6abb2308810e7572768d3b08. --- .changeset/orange-rabbits-juggle.md | 5 ----- packages/react-hooks/src/hooks/media.ts | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 .changeset/orange-rabbits-juggle.md diff --git a/.changeset/orange-rabbits-juggle.md b/.changeset/orange-rabbits-juggle.md deleted file mode 100644 index 88aec3107f..0000000000 --- a/.changeset/orange-rabbits-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@shopify/react-hooks': minor ---- - -Make useMedia options an optional param diff --git a/packages/react-hooks/src/hooks/media.ts b/packages/react-hooks/src/hooks/media.ts index 3871615202..bb4ff276e9 100644 --- a/packages/react-hooks/src/hooks/media.ts +++ b/packages/react-hooks/src/hooks/media.ts @@ -3,7 +3,7 @@ import {useState, useEffect, useLayoutEffect} from 'react'; type EffectHook = typeof useEffect | typeof useLayoutEffect; function createUseMediaFactory(useEffectHook: EffectHook) { - return (query: string, {initialValue}: {initialValue?: boolean} = {}) => { + return (query: string, {initialValue}: {initialValue?: boolean}) => { const [match, setMatch] = useState(() => initialValue === undefined ? window.matchMedia(query).matches