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: README.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ You can find the library on `window.ReactMedia`.
38
38
39
39
Render a `<Media>` component with a `query` prop whose value is a valid [CSS media query](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries). The `children` prop should be a function whose only argument will be a boolean flag that indicates whether the media query matches or not.
40
40
41
-
```js
41
+
```jsx
42
42
importReactfrom'react'
43
43
importMediafrom'react-media'
44
44
@@ -65,7 +65,7 @@ If you use a regular React element as `children` (i.e. `<Media><SomethingHere/><
65
65
66
66
For the common case of "only render something when the media query matches", you can use a `render` prop that is only called if the query matches.
67
67
68
-
```js
68
+
```jsx
69
69
importReactfrom'react'
70
70
importMediafrom'react-media'
71
71
@@ -86,7 +86,7 @@ The `render` prop is never called if the query does not match.
86
86
87
87
`<Media query>` also accepts an object, similar to [React's built-in support for inline style objects](https://facebook.github.io/react/tips/inline-styles.html) in e.g. `<div style>`. These objects are converted to CSS media queries via [json2mq](https://github.com/akiran/json2mq/blob/master/README.md#usage).
0 commit comments