You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I import package to working.thread.js code to use it, I get the error "null is not an object (evaluating 'Package_Name')"
So, how can I use packages in the threads?
import { self } from 'react-native-threads';
import './config';
import { start, stop } from "react-native-beep-tone";
var g=false;
self.onmessage = message => {
for (let i = 1; i <= 30; i++){
setTimeout(function(){
//console.tron.log(`THREAD: got message ${i}`);
g=!g;
if (g){
start(50); // Start playing the sound
}
else{
stop(); // Stop playing the sound
}
//self.postMessage(`Message from worker thread!`);
}, i * 1000);
}
}
The text was updated successfully, but these errors were encountered:
Also note that only the official react native modules are available from your threads (vibration, fetch, etc...). To include additional native modules in your threads, pass them into the RNThreadPackage constructor after the mReactNativeHost like this: new RNThreadPackage(mReactNativeHost, new ExampleNativePackage(), new SQLitePackage())
When I import package to working.thread.js code to use it, I get the error "null is not an object (evaluating 'Package_Name')"
So, how can I use packages in the threads?
The text was updated successfully, but these errors were encountered: