小编Pab*_*ino的帖子

React Native Chrome 调试器错误:NativeUIManager.getConstantsForViewManager('Text') 引发异常

我正在用 React Native 进行新开发。

首先,我npx react-native init hello_world --template react-native-template-typescript创建了基本代码,然后用以下代码替换了 app.tsx:

import React from 'react';
import {StyleSheet, Text, View} from 'react-native';

const App = () => {
  return (
    <View style={styles.helloWorldContainer}>
      <Text style={{fontSize: 18}}>Hello, world!</Text>
    </View>
  );
};

const styles = StyleSheet.create({
  helloWorldContainer: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default App;
Run Code Online (Sandbox Code Playgroud)

这些是我在调试模式下遇到的错误: 错误图片

错误图片

如果我删除组件文本的样式,错误就会消失。我的问题是如何修复错误,同时保留组件文本中的样式。我看到chrome有很多错误,是否有另一个更好的调试器?

react-native

7
推荐指数
1
解决办法
7739
查看次数

标签 统计

react-native ×1