title: Fetch JSON file from url in Javascript, React Native
body: <p>I have a problem fetching JSON data from url. I would really appreciate it if you could help me solve this issue.</p>
  
  <p>I wanted to fetch JSON data from firebase storage, but somewhat I can't, so I simplified the code and now it's really simple, but no luck.
  I also searched the cause of the error in this community, but I didn't find it.</p>
  
  <p>This is my code.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
  
  export default class App extends Component {
    render() {
      return (
        &lt;View&gt;
          &lt;TouchableOpacity onPress={this.handleOnPress}&gt;
            &lt;Text&gt;test&lt;/Text&gt;
          &lt;/TouchableOpacity&gt;
        &lt;/View&gt;
      );
    }
    handleOnPress = () =&gt; {
      console.log('test was clicked');
      fetch('https://facebook.github.io/react-native/movies.json')
        .then(response =&gt; response.json())
        .then(data =&gt; console.log(data))
        .catch(error =&gt; console.error(error));
    };
  }
  </code></pre>
  
  <p>needless to say, the message, 'test was clicked' is displayed without any problem</p>
  
  <p>Error message</p>
  
  <pre><code>Error: "Failed to fetch" in TypeError: Failed to fetch ...
  </code></pre>
  
  <p>I use Expo Snack, web compiler. </p>
  
  <p>Thank you.</p>