6

I'm newly developing in react native.

To start I used npx react-native init hello_world --template react-native-template-typescript to create the basic code and then I replaced app.tsx with this code:

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;

And these are the errors that I get when I am in debug mode: Error picture

Error picture

If I remove the style of the component Text the error disappears. My question is how can I fix the error while keeping the style in the component Text. I saw that chrome has a lot of errors, exist another better debugger?

Kirill Novikov
  • 2,576
  • 4
  • 20
  • 33

1 Answers1

3

As what Lucas Azambuja Santos referred to, it's a bug in react-native 0.65.* check out the new issue https://github.com/facebook/react-native/issues/32197

it should be fixed with 0.66, to workaround downgrade to 0.64.x and rebuild:

cd android && ./gradlew clean cleanBuildCache
cinatic
  • 861
  • 12
  • 19