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

426
Views
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 answers
Answer question

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 Report

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 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!