undefined is not a function (evaluating '_this._registerEvents()')

我的未来我决定 提交于 2020-01-03 09:07:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!