This is essentially all that my app does:
web/index.js
import React, { AppRegistry } from 'react-native'
import MyView from './../app/myview'
AppRegistry.registerComponent('MyView', () => MyView);
AppRegistry.runApplication('MyView', {
rootTag: document.getElementById('react-root')
});
app/myview.js
import React, {View, Text} from 'react-native';
export default class MyView extends React.Component {
render() {
return (
<View>
<Text>React-Native. Hello World!</Text>
</View>
)
}
}
Whenever I run this in a browser with webpack-dev-server, clicking anywhere on the browser gives the error in the console:
Firefox
TypeError: nativeEvent.type is undefined
Chrome
Uncaught TypeError: Cannot read property 'indexOf' of undefined
The line it is pointing to is this:
function normalizeNativeEvent(nativeEvent) {
>> var mouse = nativeEvent.type.indexOf('mouse') >= 0;
return mouse ? normalizeMouseEvent(nativeEvent) : normalizeTouchEvent(nativeEvent);
}
I am doing absolutely nothing fancy, and I am not sure why this error is occuring. It is also not allowing me to use TouchableOpacity or any of the other Touchable* components' onPress event. All I see is this error whenever I click anywhere.
This issue was caused by a misconfiguration on my side. Closing this issue. Kindly reply if you would like me to ellaborate on what exactly the misconfiguration was.
Hi rohanprabhu, I have encounter this issue just now, could you share what's your findings? Thanks in advance.
@rohanprabhu what was your configuration issue?