Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RNCNetInfo.getCurrentState got 3 arguments, expected 2. #297

Closed
SanjanaTailor opened this issue Jan 30, 2020 · 8 comments
Closed

RNCNetInfo.getCurrentState got 3 arguments, expected 2. #297

SanjanaTailor opened this issue Jan 30, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@SanjanaTailor
Copy link

Enviornment info :
System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
Memory: 1.06 GB / 7.88 GB
Binaries:
Node: 8.16.1 - C:\Program Files\nodejs\node.EXE
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 21, 22, 23, 24, 25, 26, 27, 28, 29
Build Tools: 26.0.2, 28.0.3, 29.0.2
System Images: android-24 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548
npmPackages:
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

Facing this problem using expo directory.
import {AppState } from 'react-native';
import NetInfo from '@react-native-community/netinfo';

Using this two library

@SanjanaTailor SanjanaTailor added the bug Something isn't working label Jan 30, 2020
@Abdelrahman-Nabil
Copy link

i had this issue with Expo SDK 35.0.0, and fixed it by installing version 5.0.0 instead of the latest version:
yarn add @react-native-community/netinfo@5.0.0

@matt-oakes
Copy link
Collaborator

👋 This is an issue because Expo seems to include an old version of the native code. Their documentation should say which version of this library is supported. If you are having issues with expo, please open issues on their repo as they wrap this library in their own code (as far as I can tell).

@lipe-dev
Copy link

lipe-dev commented Feb 3, 2020

I tried everything I could after hitting this bug on expo as well, I even tried downgrading to sdk 35 and using an earlier version like @Abdelrahman-Nabil did to no avail.

I don't feel like ejecting, so I guess I'm just not using Pusher then 🤷‍♂️

@chamaldesilva
Copy link

i had this issue with Expo SDK 35.0.0, and fixed it by installing version 5.0.0 instead of the latest version:
yarn add @react-native-community/netinfo@5.0.0

worked for me!

@ghasemikasra39
Copy link

same here

@azizulhaq800804
Copy link

azizulhaq800804 commented May 28, 2020

I had the same issue. Solved by using NetInfo from react-naitve instead of using community version. Had NetInfo.getConnectionInfo method. Using fetch() showing deprecated warning.

@Arkan4ik
Copy link

@azizulhaq800804 we should use community version according to documentation https://reactnative.dev/docs/0.61/netinfo

@tosebikan
Copy link

React-Native v0.67.4 i was able to resolve this by updating the @react-native-community/netinfo package to the exact version 4.6.0, without the ^, cleaning the build & rebuilding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants