question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: RCNNetInfo - You are using the deprecated API

See original GitHub issue

pusher-js lib appears to be calling a deprecated method from react-native-netinfo.

Warning: RCNNetInfo - You are using the deprecated API...

At a base level test case literally just having the latest installed: “@react-native-community/netinfo”: “^4.2.0” and having a file with nothing in it other than import Pusher from ‘pusher-js/react-native’: “5.0.1”

i will get the warning, when deploying to ios/android simulator

i dug a little into the “@react-native-community/netinfo” specifically https://github.com/react-native-community/react-native-netinfo/blob/master/src/index.ts line 144:

/**
 * Deprecated method to get the current state. You should upgrade to the new `fetch` method and
 * handle the new state type.
 *
 * @deprecated
 */
export function getConnectionInfo(): Promise<DeprecatedTypes.NetInfoData> {
  DeprecatedUtils.warnOnce();
  return DeprecatedState.latest();
}

Will the next update call the new fetch method, or am i missing something? Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
leesiocommented, Sep 25, 2019

I just merged and released version 5.0.2 on npm/everywhere else. There should no longer be deprecation warnings about the netinfo API.

@subotkevic @Deg5112, could you confirm whether this solves your problem? If so I’ll close this ticket.

1reaction
leesiocommented, Sep 24, 2019

I would say Friday at the latest.

Thanks again for your contribution @subotkevic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning after installing react-navigation in a react native project
If react-native-gesture-handler is using or overriding deprecated APIs you could flag an issue on their repo, or fix it yourself by making a ......
Read more >
React Native: Deprecated API Usage Apple warning
Fixing ITMS-90809: Deprecated API Usage Apple warning for React Native apps, by finding out which library still uses UIWebView.
Read more >
Bountysource
Warning : RCNNetInfo - You are using the deprecated API.
Read more >
'basevariant' is deprecated. deprecated in java - You.com
'BaseVariant' has been deprecated. I am using BaseVariant like this. import com.android.build.gradle.api.BaseVariant var bundleForVariant: (BaseVariant) ...
Read more >
NPM deprecated warning : r/npm - Reddit
new code should use the URLSearchParams API instead. npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found