_reactNativeHealth.default.initHealthKit is not a function (it is undefined) error

I ran into the React Native HealthKit initialization error "_reactNativeHealth.default.initHealthKit is not a function (it is undefined)" and found it was caused by RN's new lazy-loading mechanism for modules, which leaves NativeModules as an empty object. I temporarily worked around it by manually grabbing the functions I needed and assigning them to the Kit object, so I could keep developing.

App Development

Multipart body must have at least one part

Using RN caused this error. After checking, the problematic code is: postJson(cmd, dataObj) { let url = Defines.SERVER_ADDR + cmd; let formData = new FormData(); ...

App Development