React native and webassembly issues - react-native

We wrote an algorithm using rust and we compiled the code to web assembly
we want to integrate those functions into a react native app,
so i took the compiled folder that contain .wasm it shows.
Error: Unable to resolve module ./fn_op.wasm from
assets/libs/ofs_wasm/index.js
How can i resolve this issue with react native and how to integrate .wasm files into it
is there a configuration that i can override same as the case with react-cli for webpack

Related

How to link native library to react native application and what is the folder structure?

I am trying to build simple app to creative native library and link with react native app.
I am facing issue like
Error : Unable to resolve module react-native-fingerprint from App.js: react-native-fingerprint could not be found within the project.
Note : 'react-native-fingerprint' which is been created and want to link with app.
I guess you're using react-native-fingerprint-scanner. Since library you mentioned doesn't exist.
In case if you using this library react-native-fingerprint-scanner.
Installation
npm install react-native-fingerprint-scanner --save
or
yarn add react-native-fingerprint-scanner
Link to Native Platforms
react-native link react-native-fingerprint-scanner
Even after this it is not working. Following this guide

react native how to know if a repo I am importing is a native module

my question might be a little bit silly or ambiguous since I am fairly new to react native.
I'm trying to use the following repository for my react-native project https://github.com/smekalka/react-native-universal-pedometer. I have noticed that the repo is implemented in .java with platform folder unlike the regular .js or .ts files I used to see. Is this repository considered native module as react native doc describe?
Or in general how I can tell the whatever lib I am using is a native module.
The project is previously tested are under the support of expo-cli. I experienced the error null is not n object while using this repo. If so, I am probably going to eject the expo-cli and rewrite my code so I can use and even create own native-module for full control, some core implementations that written in other languages or expo-cli does not support.
Yes, the android and ios directories in the repository contain the 'native' code used to implement the platform-specific hooks that the Javascript will be able to pick up. Expo is not able to use these native modules or native code so your assumption is correct; you will need to eject your app in order to use this module.
If your app is below version 0.60 of React Native, after installing the module you will need to run react-native link react-native-universal-pedometer to link the native code to the Javascript runtime. If you're above 0.60, it will link automatically when installed.

Native Module cannot be null - when integrating react-native project inside another react-native project

I have a react-native cross platform project based on Underdark library for exchanging data using Bluetooth and Wifi. this is working as react-native project. I am able to transfer data between iPhone and android.
Now i want to integrate this into another react native project as a package or use it in another project. But the private Underdark react native project is not a proper package in itself. It is just a working react native project.
I have integrated by using the following commands.
npm install —save
In Xcode I have imported the project and added the libraries/framework (underdark and protocol buffers ) into Build phases.
On the react side the entire project gets installed under node-modules.
Now i create a component and import the files in underdark library in node modules.
I run the react-native run-ios command to run it on my device.
It builds successfully but gives the following error.
2017-06-29 12:31:27.406 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2017-06-29 12:31:27.523 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
My question is
Is it possible to use a react native project in another project as a third party library. even if it is not a package.
How to remove this error.

Cannot find module for pre-built browserify package in react-native

I am building an application using react native and the code depends on a third party library which only offers pre-built browserify bundle.
It works fine in the browser, but when I am using it in react native, it is throwing error as cannot find module .
I think it might be some piece of code which cannot work in react native but can work in browser but with the error I cannot figure it out.
Is there a solution for this.
Thanks.

React native source not compiling correctly when using mocha + babel

Im having a bit of an issue after upgrading to React Native 0.30. Using mocha, and babel I transpile the react native source before test run. I'm now seeing issues where modules cannot be found.
Here's an example:
Error: Cannot find module 'AssetRegistry'
The corresponding file can be found here https://github.com/facebook/react-native/blob/master/Libraries/Image/AssetSourceResolver.js#L21. It looks as if babel cannot locate the AssetRegistry file that is local in this directory.
Ok so it turns out that react-native-maps was calling an internal react-native library. react-native-mock has most of the internals mocked for react native however the internal library for the Image utility was not mocked.
I just used mockery to mock the library and all seems to work now.