Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

428
Vistas
React Native fetch throws undefined is not a function evaluating ((0,_reactNative.fetch)

Am new to react native, am trying to access remote url throws this error. "undefined is not a function evaluating ((0,_reactNative.fetch)". Not sure what am doing wrong; Please help. Am using the latest version of react native 0.40

import React, { Component } from "react";
import { 
  View, 
  Text,
  Button,
  fetch,
  NativeModules,
  NativeEventEmitter 
} from "react-native";

export default class VideoScreen extends Component {
    componentDidMount(){
       this.video();
    }
    video(){
       fetch('http://localhost:4200/token').then(function(res) {
         console.log(res.json());

        })
    }

}
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

removing fetch from the import statement makes it work.

import { 
  View, 
  Text,
  Button,
  NativeModules,
  NativeEventEmitter 
} from "react-native";
over 4 years ago · Santiago Trujillo Denunciar

0

I had the same problem and it is resolved by adding this code to App.js :

if(typeof global.self === "undefined")
{
    global.self = global;
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda