Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

427
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda