javascriptandroidreactjsreact-nativenpm

Logging not working in my react native app


I have a react native app that is running on my android studio emulator and the logging does not show in my terminal nor in my active remote debbugger in Chrome when debugging is enabled. For example when I want to log a simple text in one of my components:

import React from "react";

const EmployeeList = () => { 
     //logging to check whether it works
     console.log("Check logging");
    
  return (
    <View style={styles.componentRoot}>
//SOME RENDERING
      <LoadingModal loading={querying} text="Lade" />
    </View>
  );
};

const heading = { paddingHorizontal: config.screenPadding };

const styles = StyleSheet.create({
 // Some Styles 
});

export default EmployeeList;


I have also tried npx react-native logs-android but it just does not show me the logs. Note: I am not using Expo! and I also see "Console was cleared" when I go to my remote debugger in chrome


Solution

  • So after a lot of trial and error, the thing I did that fixed my issue was to start the app using:

    npm run start