-
Notifications
You must be signed in to change notification settings - Fork 239
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
Doesn't work with new bridgeless architecture on 0.76.0 #395
Comments
Native Emitter is not getting triggered in my case event after checking the apple health or updating the data. My Project details :
However in both of cases nativeEmitter is not getting triggered and I'm not able to get any data in background / foreground. There is no proper example in the documentation as well how does the background listening of data work. a very short explanation on that. Any hints on getting background data updates would be helpful. I want to get data every time when there is change in data for health app. however as of now it doesn't matter for me after how much interval I get the updated data. does anyone know the solution? In existing issues find that most of the users are facing background issue updated. sample code on background listeners would really help? |
Describe the bug
Because the new react-native architecture lazy loads modules by default,
require('react-native').NativeModules
is an empty object at app startup time. Search for "Lazy module loading by default" in https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-hereTo Reproduce
Load the app on React Native 0.76.0 and observe that all functions expected on
AppleHealthKit
are undefined.Expected behavior
All functions on
AppleHealthKit
are should be defined at access time.Workaround Confirmed to Work
Per this user's helpful comment (facebook/react-native#29228 (comment)), this workaround fixes the issue for MY app which only uses a handful of functions from
react-native-health
. This is far from a global solution though. I'm usingyarn
so I'm able to simply do ayarn patch react-native-health
to be unblocked with this change:index.js
The text was updated successfully, but these errors were encountered: