title: referenceError: Can't find variable in react-native with fetch
body: <p>hey im trying to make a chart using victory from the data online json data in react native. the code for the component is like below</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export default class Dashboard extends Component {
    static navigationOption = {
      title: 'DashboardScreen'
    }
  
  state = {
        getValue: '',
        dataSource:[],
        isLoading: true
      }
  
  
    componentDidMount() {
     
      const url = 'myurl';
      fetch(url, {
        method: 'GET',
        headers: new Headers({
          'Content-Type' : 'application/json',
        })
      })
      .then((response)=&gt; response.json() )
      .then((responseJson) =&gt; {
        console.log(responseJson.Views)
        this.setState({
          dataSource: responseJson,
          isLoading: false
        })
      })
      .catch((Error) =&gt; {
        console.log(Error)
      })
  
  
    }
  
    render() {
        return(
            &lt;View style = {styles.container}&gt;
                &lt;VictoryChart minDomain={{ y: 0, x:0 }} width={350} theme={VictoryTheme.material}&gt;
                  &lt;VictoryBar
                      style={{
                        data: { stroke: "#c43a31" },
                        parent: { border: "1px solid #ccc"}
                      }}
                      data={[
                        { x: 1, y: 1 },
                        { x: 2, y: dataSource[0].views},
                        { x: 3, y: dataSource[1].views},
                        { x: 4, y: dataSource[2].views},
                        { x: 5, y: dataSource[3].views}
                        ]}&gt; 
                  &lt;/VictoryBar&gt;
                &lt;/VictoryChart&gt;
            &lt;/View&gt;
        )
    }
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>i thought the fetch already make the json information an array in dataSource Variable and can be used as a data in victory but i always got error like referenceError: Can't find variable 'dataSource'</p>
  
  <p>So, it would be very nice if anyone helps me out with this code and suggest how make the json data into chart</p>