插值不起作用 - 抽屉导航
Posted
技术标签:
【中文标题】插值不起作用 - 抽屉导航【英文标题】:Interpolate is not function - Drawer Navigation 【发布时间】:2021-09-17 17:16:17 【问题描述】:在导入抽屉导航后运行我的项目显示此错误...
AppLoading threw an unexpected error when loading:
TypeError: interpolate is not a function. (In 'interpolate(this.progress,
inputRange: [PROGRESS_EPSILON, 1],
outputRange: [0, 1]
)', 'interpolate' is undefined)
at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\expo-app-loading\build\AppLoading.js:11:12 in
startLoadingAppResourcesAsync._catch$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in
tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in
setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in
_callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in
__callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in
__guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in
flushedQueue
at [native code]:null in flushedQueue
at [native code]:null in callFunctionReturnFlushedQueue
即使在安装了重新激活的版本 1 之后,它也会显示不同的错误,而不是这个。
【问题讨论】:
你确定你一步步跟着 react 导航安装?上述错误可能伴随着反应导航缺少库 您使用的是 react-native 0.60.0 或更高版本吗?安装后是否使用链接? 阅读:github.com/react-navigation/react-navigation/issues/7504 我有同样的问题,它是一个依赖问题 【参考方案1】:正如 TERMINATOR 所说,这是一个依赖问题。使用他提供的链接或关注此link 到另一个线程,但使用不同的解决方案。
这个答案说给npm uninstall react-native-reanimated
,然后说给npm install react-native-reanimated@2.1.0
。但是我必须使用npm install --force react-native-reanimated@2.1.0
才能让它正确安装在我的机器上。
【讨论】:
以上是关于插值不起作用 - 抽屉导航的主要内容,如果未能解决你的问题,请参考以下文章