未定义不是函数(评估'_this._registerEvents()') [英] undefined is not a function (evaluating '_this._registerEvents()')

查看:83
本文介绍了未定义不是函数(评估'_this._registerEvents()')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我删除我的src文件夹以便重构此错误之后.我相信这是一个缓存问题?我尝试遵循此要点,但是没有运气.

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.

反应":"16.4.1",

"react": "16.4.1",

"react-native":"0.56.1",

"react-native": "0.56.1",

"@ babel/core":"^ 7.1.2",

"@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>
        );
    }
}

`

推荐答案

打开终端/CMD/shell并依次运行这些命令

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

这篇关于未定义不是函数(评估'_this._registerEvents()')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆