Skip to content

Commit bad172c

Browse files
committed
Fix up comments, bump dep to RN 43.0 + React 16
1 parent 228b977 commit bad172c

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/node_modules
22
npm-debug.log
33

4+
# EMACS
5+
\#*#
6+
[#]*[#]
7+
\.#*
48

59
# OSX
610
#

components/Hero.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import React, { Component } from 'react';
44
import { Image, StyleSheet, View, Dimensions } from 'react-native';
55
import PropTypes from 'prop-types';
66

7-
// a -> b
7+
// createPositionStyle :: Number -> Object
88
const createPositionStyle = (zIndex=1) => ({
99
top: 0,
1010
zIndex
1111
});
1212

13-
// a -> a
13+
// updateWidthState :: Component, Window -> _
1414
const updateWidthState = (component, window) => {
1515
if (!component) return;
1616
component.setState({
1717
width: window.width
1818
});
1919
}
20-
// a, b -> b
20+
2121
export default class Hero extends Component {
2222
static propTypes = {
2323
renderOverlay: PropTypes.func,
@@ -89,7 +89,9 @@ export default class Hero extends Component {
8989
// Initial width state set
9090
if ((this.props.fullWidth === true) && (!self.state.width)) {
9191
updateWidthState(self, Dimensions.get('window'));
92-
Dimensions.addEventListener('change', (window, screen) => updateWidthState(self, window));
92+
// This requires RN ^0.43 + React ^16, may consider alternative updating method for better
93+
// backwards compatability
94+
Dimensions.addEventListener('change', (window) => updateWidthState(self, window));
9395
}
9496
};
9597

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-hero",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "A super duper react-native hero component",
55
"main": "./components/Hero.js",
66
"scripts": {
@@ -28,12 +28,12 @@
2828
"homepage": "https://github.com/brh55/react-native-hero#readme",
2929
"devDependencies": {
3030
"jest": "^19.0.2",
31-
"react": "^15.4.2",
32-
"react-native": "^0.42.3"
31+
"react": "^16.0.0",
32+
"react-native": "^0.43.0"
3333
},
3434
"peerDependencies": {
35-
"react": "*",
36-
"react-native": "*"
35+
"react": "^16.0.0",
36+
"react-native": "^43.0.0"
3737
},
3838
"jest": {
3939
"preset": "react-native"

0 commit comments

Comments
 (0)