Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 我可以在React Native中使用工人类吗?_Node.js_Html_Multithreading_React Native - Fatal编程技术网

Node.js 我可以在React Native中使用工人类吗?

Node.js 我可以在React Native中使用工人类吗?,node.js,html,multithreading,react-native,Node.js,Html,Multithreading,React Native,我能做点像这样的事吗 let worker = new Worker("./module.js", {type: "module"}); 在的上下文中,反应为本机?它是否在后台线程中运行模块?如果是,谁在处理线程封送?我认为这在react native环境下是不可能的,因为Worker依赖HTML5。确认?我很确定您需要一个第三方库: 一旦安装了它,只需覆盖Worker: import { Worker } from 'react-native-workers';

我能做点像这样的事吗

let worker = new Worker("./module.js", {type: "module"});

的上下文中,反应为本机?它是否在后台线程中运行模块?如果是,谁在处理线程封送?我认为这在react native环境下是不可能的,因为Worker依赖HTML5。确认?

我很确定您需要一个第三方库:

一旦安装了它,只需覆盖
Worker

import { Worker } from 'react-native-workers';