react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Native modules return empty object {}

Open TusharGameskraft opened this issue 3 years ago • 2 comments

Description

import { NativeModules } from 'react-native'; const { MyModule } = NativeModules; my MyModule is null and native modules return empty object it works in previous versions. This works in previous react native versions

Version

0.70.5

Output of npx react-native info

NA

Steps to reproduce

  • use npx react-native init AwesomeProject to create a new project
  • follow this doc native-modules-ios to try to add a native module
  • NativeModules always returns {}

Snack, code example, screenshot, or link to a repository

NA

TusharGameskraft avatar Nov 10 '22 11:11 TusharGameskraft

which version of react-native did this work for you? Currently I have a new react-native project and facing the same issue on android. Followed the guide on 0.71.3, but would like to start again with a working version

silvabacc avatar Mar 07 '23 21:03 silvabacc

Turns out... After looking into other issues, it's possible that the object may appear as empty but it isn't the case. My NativeModule appears to be working

silvabacc avatar Mar 07 '23 21:03 silvabacc

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 04 '23 05:09 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Sep 11 '23 05:09 github-actions[bot]