gpt4 book ai didi

react-native - React Native Chrome Debugger Error : NativeUIManager. getConstantsForViewManager ('Text' ) 抛出异常

转载 作者:行者123 更新时间:2023-12-04 11:43:31 34 4
gpt4 key购买 nike

我正在开发 native react 。
首先,我使用了 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;
这些是我在 Debug模式下得到的错误:
Error picture 1
Error picture 2
如果我删除组件 Text 的样式,错误就会消失。
我的问题是如何在保持组件 Text 中的样式的同时修复错误。
我看到 chrome 有很多错误,还有另一个更好的调试器吗?

最佳答案

作为什么Lucas Azambuja Santos提到,这是 react-native 0.65.* 中的一个错误查看新问题 https://github.com/facebook/react-native/issues/32197
它应该用 0.66 修复,以解决方法降级到 0.64.x 并重建:

cd android && ./gradlew clean cleanBuildCache

关于react-native - React Native Chrome Debugger Error : NativeUIManager. getConstantsForViewManager ('Text' ) 抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68940923/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com