4

Environment

  Expo CLI 3.11.7 environment info:
    System:
      OS: Linux 5.0 Ubuntu 18.04.3 LTS (Bionic Beaver)
      Shell: 4.4.20 - /bin/bash
    Binaries:
      Node: 12.14.0 - /usr/bin/node
      npm: 6.13.4 - /usr/bin/npm
    npmPackages:
      @types/react: ~16.9.0 => 16.9.17 
      @types/react-native: ~0.60.23 => 0.60.25 
      expo: ~36.0.0 => 36.0.2 
      react: ~16.9.0 => 16.9.0 
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4 
      react-navigation: ^4.0.10 => 4.0.10 
    npmGlobalPackages:
      expo-cli: 3.11.7

Problem

I installed netInfo in expo using the recommended command by expo documentation here https://docs.expo.io/versions/latest/sdk/netinfo/ : expo install @react-native-community/netinfo After that I just tried to get the status of the connection to check if everything was working fine adding the next code:

import NetInfo from '@react-native-community/netinfo';

const MyCases = ({ cases }: Props) => {
useEffect(() => {
      (async function anyNameFunction() {
         const netInfoState = await NetInfo.fetch();
         console.warn(netInfoState);
      })();
   }, []);
};

After doing the mentioned previous steps any time I opened the app in iOS it crashes instantly and closes. By the other hand, in android it doesn't closes but it shows this error message: RNCNetInfo.getCurrentState got 3 arguments, expected 2 I don't know what to do because, supposedly, in Expo enviroment linking is not needed and not possible

Drashti Kheni
  • 1,065
  • 9
  • 23
rodricass
  • 155
  • 1
  • 5

1 Answers1

0

This bug is related to netinfo version@4.x.x to fix that just update the module to version @5.0.0

Audrey
  • 401
  • 2
  • 7
  • 15