-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Touchable not working #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Any example code? How are you importing components? It looks like the |
// @flow
import React, { Component } from 'react';
import {
View,
Text,
TouchableOpacity,
} from 'react-native';
export default class Button extends Component {
_handlePress: Function = () => {
alert('clicked');
}
render() {
return (
<TouchableOpacity onPress={this._handlePress}>
<Text>Click Me !</Text>
</TouchableOpacity>
);
}
} |
I can't reproduce the issue on codepen - https://codepen.io/necolas/pen/aBpeMB?editors=0011 - or in the official examples. |
I downloaded the react-native-web-starter example and tried to use TouchableOpacity and got the same error |
hi, i have the same problem, my config is:
import React, { Component } from 'react'
import {
AppRegistry,
StyleSheet,
View,
Text,
TouchableHighlight,
} from 'react-native'
import { observer } from 'mobx-react/native'
const styles = StyleSheet.create({
home: {
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}
});
class Home extends Component {
render() {
const { store } = this.props;
return (
<View style={styles.home}>
<Text>Home {store.counter}</Text>
<TouchableHighlight onPress={() => store.up()}>
<Text>Up</Text>
</TouchableHighlight>
<TouchableHighlight onPress={() => store.down()}>
<Text>Down</Text>
</TouchableHighlight>
<TouchableHighlight onPress={() => store.reset()}>
<Text>Reset</Text>
</TouchableHighlight>
</View>
)
}
}
export default observer(Home)
|
I resolved the issue by downgrading to 0.0.49. |
Same as @wcastand. Might be a result of the react 15.4.0 release. They moved a bunch of classes around that RNW directly depends upon. The issue I'm encountering is that even if I peg react to 15.3.2, react-native-web declares this dependency
which is satisfied by 15.4.0 and seems to be incompatible with react-native-web at the moment. |
Yeah this looks like a [email protected] issue (see #255). Was confusing because your reports state that you're using [email protected] |
Hi, can you check pls this fork of React Native for Web: Playground? |
Hi, go to web index.js and replace ReactDOM.render.... by ReactNative.render(, document.getElementById('root')); |
Uh oh!
There was an error while loading. Please reload this page.
Whenever I use TouchableOpacity or TouchableHighlight, I get this error in the console :
The page display properly but the onPress event is not fired when I click.
Environment (include versions)
OS: Windows 10
Device:
Browser: Chrome
React Native for Web (version): 0.0.49
React (version): 15.4.0
The text was updated successfully, but these errors were encountered: