You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/svelte/src/reactivity/media-query.js
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,18 @@ import { on } from '../events/index.js';
3
3
4
4
/**
5
5
* Creates a media query and provides a `current` property that reflects whether or not it matches.
6
+
*
7
+
* Use it carefully — during server-side rendering, there is no way to know what the correct value should be, potentially causing content to change upon hydration.
8
+
*
9
+
* ```svelte
10
+
* <script>
11
+
* import { MediaQuery } from 'svelte/reactivity';
12
+
*
13
+
* const large = new MediaQuery('min-width: 800px');
* Creates a media query and provides a `current` property that reflects whether or not it matches.
1756
+
*
1757
+
* Use it carefully — during server-side rendering, there is no way to know what the correct value should be, potentially causing content to change upon hydration.
1758
+
*
1759
+
* ```svelte
1760
+
* <script>
1761
+
* import { MediaQuery } from 'svelte/reactivity';
1762
+
*
1763
+
* const large = new MediaQuery('min-width: 800px');
0 commit comments