问题
After i deleted my src folder in order to refactor this error occurred. I believe this is a caching issue? I tried following this gist but no luck.
"react": "16.4.1",
"react-native": "0.56.1",
"@babel/core": "^7.1.2",
"presets": ["react-native"]
`
import React, { Component } from 'react';
import { Platform, Text, View } from 'react-native';
import { Provider } from 'react-redux';
import { store } from './src/redux/store';
export default class App extends Component<Props> {
state = {
isLoadingComplete: false,
};
render() {
return (
<View>
<Text>Hello??</Text>
<Text>Hello??</Text>
<Text>Hello??</Text>
<Text>Hello??</Text>
<Text>Hello??</Text>
<Text>Hello??</Text>
<Text>Hello??</Text>
</View>
);
}
}
`
回答1:
Open your terminal/CMD/shell and run these commands one after another
cd yourProjectDiectory ----> navigate to your project directory
watchman watch-del-all
rm -rf node_modules/.cache
react-native start --resetCache
回答2:
close your server and run npm start -- --reset-cache
then reload the app
回答3:
I had this problem after upgrade of React-native to 0.58.1.
None of the above answers worked for me. I tried to upgrade to 0.58.6, didn't help.
The problem was solved after upgrading to react-native 0.59.1.
来源:https://stackoverflow.com/questions/52713101/undefined-is-not-a-function-evaluating-this-registerevents