Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.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 window.getComponentStyle不是函数或找不到变量文档_Node.js_React Native_React Native Paper - Fatal编程技术网

Node.js window.getComponentStyle不是函数或找不到变量文档

Node.js window.getComponentStyle不是函数或找不到变量文档,node.js,react-native,react-native-paper,Node.js,React Native,React Native Paper,我已经吃过了-paper@4.8.1版本 这会导致编译代码时出现多个错误 /node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx ./node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx 115:18-24 [tsl]在/node_modules/react native p

我已经吃过了-paper@4.8.1版本 这会导致编译代码时出现多个错误

/node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx ./node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx 115:18-24 [tsl]在/node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx(115,19)中出错 TS2304:找不到名称“窗口”。 /node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx ./node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx 141:22-30 [tsl]在/node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx中出错(141,23) TS2584:找不到名称“文档”。是否需要更改目标库?尝试更改lib编译器选项以包含“dom”。 /node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx ./node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx 160:19-27 [tsl]在/node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx中出错(160,20)

TS2584:找不到名称“文档”。是否需要更改目标库?尝试更改lib编译器选项以包含“dom”。 /node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx ./node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx 212:35-45 [tsl]在/node_modules/react native paper/src/components/TouchableRipple/TouchableRipple.tsx(212,36)中出错 TS2339:类型“HtmleElement”上不存在属性“firstChild”。 请参阅附件firsterror

为了解决这个错误,我在tsconfig.ts下的lib中添加了“DOM”。 “lib”:[“ES2015”,“dom”]

此更改后编译成功,但在运行时出错。 window.getComputedStyle不是函数&找不到变量文档。请参阅随附的错误文件

我正在使用以下版本: “反应”:“^17.0.2”, “react dom”:“^16.9.0”, “本机反应”:“^0.64.1”, “@types/react native”:“^0.64.6”,
“typescript”:“^4.2.4”,

那么随附的错误文件说明了什么?@Geshode文件随附。Erros说window.getComputedStyle不是函数。window对象是否已定义并包含getComputedStyle函数?react native中没有文档或窗口变量。react native paper library与react native web兼容,并且具有以下功能:。你应该得到本地的,但不知怎的,你得到了网络的。这是你的问题,但我不知道解决办法。