Skip to content

Commit 2bfd18e

Browse files
committed
v1.0.1
1 parent d452187 commit 2bfd18e

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ var testing = React.createClass({
6868
return (
6969
//Landscape Phone View...
7070
);
71-
} else {
71+
} else if (Display.isTablet() && Display.isPortrait()) {
7272
return (
73-
//Non-Phone / Tablet View...
73+
//Portrait Tablet View...
74+
);
75+
} else if (Display.isTablet() && Display.isLandscape()) {
76+
return (
77+
//Landscape Tablet View...
7478
);
7579
}
7680
}
@@ -83,12 +87,19 @@ With Event Listener...
8387
```javascript
8488
var Display = require('react-native-device-display');
8589

90+
var listener;
91+
8692
var testing = React.createClass({
8793

8894
componentDidMount: function() {
89-
Display.onOrientationDidChange(function() {
95+
listener = Display.onOrientationDidChange(function() {
9096
//Change States, Perform Magic, etc...
9197
});
98+
},
99+
100+
componentWillUnmount: function() {
101+
//Unlisten the onOrientationChange...
102+
listener = null;
92103
}
93104

94105
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "react-native-device-display",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"private": false,
55
"scripts": {
66
"start": "node_modules/react-native/packager/packager.sh"
77
},
8-
"dependencies": {
8+
"peerDependencies": {
99
"react-native": "^0.6.0"
1010
},
1111
"description": "A simple way to create dynamic views through device and display detection, allowing the creation of adaptable and universal apps.",

0 commit comments

Comments
 (0)