Update various packages (inc. babel and eslint)

This commit is contained in:
Nicolas Gallagher
2016-06-14 16:05:30 -07:00
parent 60ad0e9ec5
commit b56b8e494a
7 changed files with 49 additions and 43 deletions
+9 -10
View File
@@ -11,25 +11,24 @@ class ReactNativeApp extends Component {
rootTag: PropTypes.any
};
constructor(props, context) {
super(props, context)
this._handleModalVisibilityChange = this._handleModalVisibilityChange.bind(this)
}
_handleModalVisibilityChange(modalVisible) {
ReactDOM.findDOMNode(this._root).setAttribute('aria-hidden', `${modalVisible}`)
}
render() {
const { initialProps, rootComponent: RootComponent, rootTag } = this.props
return (
<View style={styles.appContainer}>
<RootComponent {...initialProps} ref={(c) => { this._root = c }} rootTag={rootTag} />
<RootComponent {...initialProps} ref={this._createRootRef} rootTag={rootTag} />
<Portal onModalVisibilityChanged={this._handleModalVisibilityChange} />
</View>
)
}
_createRootRef = (component) => {
this._root = component
}
_handleModalVisibilityChange = (modalVisible) => {
ReactDOM.findDOMNode(this._root).setAttribute('aria-hidden', `${modalVisible}`)
}
}
const styles = StyleSheet.create({
+2 -2
View File
@@ -33,7 +33,7 @@ class AppRegistry {
invariant(
runnables[appKey] && runnables[appKey].prerender,
`Application ${appKey} has not been registered. ` +
`This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.`
'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'
)
return runnables[appKey].prerender(appParameters)
@@ -78,7 +78,7 @@ class AppRegistry {
invariant(
runnables[appKey] && runnables[appKey].run,
`Application "${appKey}" has not been registered. ` +
`This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.`
'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'
)
runnables[appKey].run(appParameters)
+2 -2
View File
@@ -30,7 +30,7 @@ suite('apis/StyleSheet', () => {
`${resetCSS}\n${predefinedCSS}\n` +
`/* 2 unique declarations */\n` +
`.__style1{opacity:1;}\n` +
`.__style2{color:red;}`
'.__style2{color:red;}'
)
// teardown
@@ -45,7 +45,7 @@ suite('apis/StyleSheet', () => {
StyleSheet.renderToString(),
`${resetCSS}\n${predefinedCSS}\n` +
`/* 1 unique declarations */\n` +
`.__style1{opacity:1;}`
'.__style1{opacity:1;}'
)
})
+5 -1
View File
@@ -61,7 +61,7 @@ class ActivityIndicator extends Component {
return (
<View {...other} style={[ styles.container, style ]}>
<View
ref={(c) => { this._indicatorRef = c }}
ref={this._createIndicatorRef}
style={[
indicatorStyles[size],
hidesWhenStopped && !animating && styles.hidesWhenStopped,
@@ -72,6 +72,10 @@ class ActivityIndicator extends Component {
)
}
_createIndicatorRef = (component) => {
this._indicatorRef = component
}
_manageAnimation() {
if (this._player) {
if (this.props.animating) {
+4 -2
View File
@@ -22,14 +22,16 @@ class Text extends Component {
accessible: true
};
_onPress(e) {
_onPress = (e) => {
if (this.props.onPress) this.props.onPress(e)
}
render() {
const {
numberOfLines,
/* eslint-disable no-unused-vars */
onPress,
/* eslint-enable no-unused-vars */
style,
...other
} = this.props
@@ -38,7 +40,7 @@ class Text extends Component {
<CoreComponent
{...other}
component='span'
onClick={this._onPress.bind(this)}
onClick={this._onPress}
style={[
styles.initial,
style,