From aacfc372c9bea3ebeff5e86317ad1865a77e9cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Thomsen?= Date: Thu, 18 Aug 2016 11:46:59 -0700 Subject: [PATCH] Missing function tags Summary: It seems like it's not written in es6, hence no arrow functions, therefor we must have the function tag for it to work? Closes https://github.com/facebook/react-native/pull/9463 Differential Revision: D3736797 fbshipit-source-id: c41bbd5f6867aa0f7668f8562e69dc2812eba80a --- docs/Networking.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Networking.md b/docs/Networking.md index a4af7f503..0c15bd036 100644 --- a/docs/Networking.md +++ b/docs/Networking.md @@ -47,7 +47,7 @@ The above examples show how you can make a request. In many cases, you will want Networking is an inherently asynchronous operation. Fetch methods will return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that make it straightforward to write code that works in an asynchronous manner: ```js - getMoviesFromApiAsync() { + function getMoviesFromApiAsync() { return fetch('https://facebook.github.io/react-native/movies.json') .then((response) => response.json()) .then((responseJson) => { @@ -62,7 +62,7 @@ Networking is an inherently asynchronous operation. Fetch methods will return a You can also use the proposed ES2017 `async`/`await` syntax in a React Native app: ```js - async getMoviesFromApi() { + async function getMoviesFromApi() { try { let response = await fetch('https://facebook.github.io/react-native/movies.json'); let responseJson = await response.json();