Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

968
Views
Obteniendo 'TypeError: la interpolación no es una función' en React-Native

Estoy aprendiendo react-native actualmente.

Estoy en este proyecto que utiliza principalmente: react-navgation , FlatList y react-native-magnus para la interfaz de usuario.
Toma una matriz de objetos y usa FlatList para devolver una lista de tarjetas (de la interfaz de usuario de Magnus) para cada uno de los elementos de la matriz.

La estructura de navegación es así → Enlace a la imagen

Para una mejor accesibilidad, adjunto mi proyecto, espero que ayude → https://wetransfer.com/downloads/4b8af09bde680e8e17bcc05a662e4ef820210604152955/6b3f64

En mi código, estoy atascado en este error →

 TypeError: interpolate is not a function. (In 'interpolate(this.progress, { inputRange: [PROGRESS_EPSILON, 1], outputRange: [0, 1] })', 'interpolate' is undefined) This error is located at: in NavigationContainer (at App.js:13) in App (created by ExpoRoot) in ExpoRoot (at renderApplication.js:45) in RCTView (at View.js:34) in View (at AppContainer.js:106) in RCTView (at View.js:34) in View (at AppContainer.js:132) in AppContainer (at renderApplication.js:39) Stack trace: node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch node_modules\regenerator-runtime\runtime.js:293:29 in invoke node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch node_modules\regenerator-runtime\runtime.js:154:27 in invoke node_modules\regenerator-runtime\runtime.js:164:18 in PromiseImpl.resolve.then$argument_0 node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0 node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0 node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue [native code]:null in flushedQueue [native code]:null in invokeCallbackAndReturnFlushedQueue
Estos son los principales archivos JS del proyecto ↓, pero también mencioné un enlace a todo el proyecto arriba ↑

CÓDIGO App.js

 import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import Navigator from './routes/drawer'; //Test Screens // // import MagnusCard from './magnus/magnusCard' export default function App() { return ( <Navigator /> //<< //Test Screens // // <MagnusCard /> ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });

CÓDIGO cajón.js

 import React from 'react'; import { View, Text } from 'react-native'; import { createAppContainer } from 'react-navigation'; import { createDrawerNavigator } from 'react-navigation-drawer'; // stacks import HomeStack from './homeStack'; import AboutStack from './aboutStack'; // drawer navigation options const RootDrawerNavigator = createDrawerNavigator({ Home: { screen: HomeStack, }, About: { screen: AboutStack, }, }); export default createAppContainer(RootDrawerNavigator);

CÓDIGO homeStack.js

 import React from 'react'; import { View, Text } from 'react-native'; import { createAppContainer } from 'react-navigation'; import { createStackNavigator } from 'react-navigation-stack'; import Home from '../screens/homeStack/home' import ReviewDetails from '../screens/homeStack/reviewDetails' //Shared Components import Header from '../shared/header'; const screens = { Home: { screen: Home, navigationOptions: ({ navigation }) => { return { headerTitle: () => <Header title="Home" navigation={navigation} /> } } }, ReviewDetails: { screen: ReviewDetails, navigationOptions: { title: "Review Details" } }, } const HomeStack = createStackNavigator(screens); export default HomeStack;

CÓDIGO home.js

 import { StatusBar } from 'expo-status-bar'; import React, { useState } from 'react'; import { StyleSheet, Text, View, Button, FlatList, TouchableOpacity } from 'react-native'; // Shared Components import MagnusCard from '../../magnus/magnusCard'; export default function Home({ navigation }) { const [reviews, setReviews] = useState([ { title: 'Zelda, Breath of Fresh Air', rating: 5, body: 'lorem ipsum', key: '1' }, { title: 'Gotta Catch Them All (again)', rating: 4, body: 'lorem ipsum', key: '2' }, { title: 'Not So "Final" Fantasy', rating: 3, body: 'lorem ipsum', key: '3' }, ]); return ( <View style={styles.container}> <View style={styles.topBox}> <Button onPress={() => { navigation.navigate('ReviewDetails') }} title="Details" style={styles.btnToRevDetails} /> <Text style={styles.explainerText}>←Click here to view Review Screen</Text> </View> <View style={styles.listOfItems}> <FlatList data={reviews} renderItem={({ item }) => ( <TouchableOpacity> {/* onPress={() => navigation.navigate('ReviewDetails', item)} */} <MagnusCard /> </TouchableOpacity> )} /> </View> </View> ) } const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'column', }, topBox: { flexDirection: 'row', margin: 4, padding: 10, alignItems: 'center' }, listOfItems: { margin: 10, padding: 4 }, btnToRevDetails: { flex: 3 }, explainerText: { flex: 7, fontSize: 16, } })
over 4 years ago · Santiago Trujillo
6 answers
Answer question

0

Tal vez su versión de react-navigation-drawer esté en conflicto con la versión de react-native-reanimated. Intente ejecutar npm i --save react-native-reanimated@1.0.0 .

Si es posible, comparta su código package.json .

over 4 years ago · Santiago Trujillo Report

0

Posiblemente es un error que causa este error. Puede instalar ( react-native-reanimated@1.13.1 ) y luego expo start --clear

over 4 years ago · Santiago Trujillo Report

0

interpolate() se renombró a interpolateNode() en Reanimated 2.

over 4 years ago · Santiago Trujillo Report

0

Yo también enfrenté este problema y me rompí la cabeza durante las últimas semanas. Este parece ser el conflicto de versión entre el paquete react-navigation-drawer con react-native-reanimated. Recién ahora lo arreglé. interpolate() se renombró a interpolateNode() en react-native-reanimated@2+. No es necesario degradar el paquete react-native-reanimated.

La forma simple de solucionarlo por ahora es (traté de enviar una solicitud de extracción en la biblioteca react-navigation-drawer, sin embargo, es de solo lectura. Por lo tanto, puede cambiar esto localmente)

  1. Abra el archivo Drawer.js que se encuentra en la carpeta /node_modules/react-navigation-drawer/lib/module/views/
  2. Encontrará interpolate en dos lugares, reemplace interpolate con interpolateNode en esos dos lugares.

Reconstruya su código. Deberia de funcionar.

over 4 years ago · Santiago Trujillo Report

0

También enfrenté este problema y no tiene que degradar su react-native-reanimated. En las últimas versiones de reanimated, interpolate se cambió a interpolateNode. Así que todo lo que tienes que hacer es abrir el archivo Drawer.js que se encuentra en:

node_modules\react-navigation-drawer\lib\module\views y reemplace interpolate con interpolateNode . Está en dos lugares , así que asegúrate de cambiar ambos.

Esto debería solucionar el problema.

over 4 years ago · Santiago Trujillo Report

0

Encontré este error y lo solucioné degradando react-native-reanimate a 2.1.0 . pruébalo, pero creo que hay un error porque después de eliminar node_modules e instalar nuevamente, el problema se reprodujo y se resolvió desinstalando el paquete ( react-native-reanimate ) e instalándolo nuevamente con la versión 2.1.0

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!