Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
imhele committed Feb 9, 2019
1 parent a03e8ea commit 5ac0d41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export default () => {

### 暂停

你可以通过暂停事件监听,以便在移动设备上提供额外的*桌面版*

```jsx
import { useState } from 'react';
import useMedia from 'react-media-hook2';
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import useMedia from 'react-media-hook2';

export default () => {
const [matches, setProps] = useMedia({ query: '(max-width: 600px)' });
return <div>Width of window is {matches ? 'less' : 'greater'} than 600.</div>;
return <div>Width of window is {matches ? 'less' : 'greater'} than 600px.</div>;
};
```

Expand All @@ -49,7 +49,7 @@ import useMedia from 'react-media-hook2';

export default () => {
const [matches, setProps] = useMedia({ query: { maxWidth: 600 } });
return <div>Width of window is {matches ? 'less' : 'greater'} than 600.</div>;
return <div>Width of window is {matches ? 'less' : 'greater'} than 600px.</div>;
};
```

Expand Down Expand Up @@ -99,6 +99,8 @@ export default () => {

### Pause listener

You can pause listener to provide additional *desktop version* on mobile devices.

```jsx
import { useState } from 'react';
import useMedia from 'react-media-hook2';
Expand Down

0 comments on commit 5ac0d41

Please sign in to comment.