We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04032f3 commit 1e60c46Copy full SHA for 1e60c46
src/findBreakpoint.ts
@@ -16,7 +16,9 @@ import { Breakpoints } from './Breakpoints';
16
* // matchedValue => 'desktop'
17
*
18
*/
19
-export const findBreakpoint = (breakpoints: Breakpoints, observedSize: number): any => {
+export const findBreakpoint = (breakpoints: Breakpoints, observedSize?: number): any => {
20
+ if (typeof observedSize === 'undefined') return undefined;
21
+
22
let breakpoint: number | undefined;
23
const sizes = Object.keys(breakpoints).map(key => Number(key));
24
0 commit comments