浏览代码

Add ES5 require instruction to README.md

wkh237 8 年前
父节点
当前提交
4aa243c979
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13
    0
      README.md

+ 13
- 0
README.md 查看文件

@@ -113,9 +113,22 @@ Beginning in Android 6.0 (API level 23), users grant permissions to apps while t
113 113
 
114 114
 ## Recipes
115 115
 
116
+ES6
117
+
118
+The module uses ES6 style export statement, simply use `import` to load the module.
119
+
116 120
 ```js
117 121
 import RNFetchBlob from 'react-native-fetch-blob'
118 122
 ```
123
+
124
+ES5
125
+
126
+If you're using ES5 require statement to load the module, please add `default`. See [here](https://github.com/wkh237/react-native-fetch-blob/wiki/Trouble-Shooting#rnfetchblobfetch-is-not-a-function) for more detail.
127
+
128
+```
129
+var RNFetchBlob = require('react-native-fetch-blob').default
130
+```
131
+
119 132
 #### Download example : Fetch files that needs authorization token
120 133
 
121 134
 ```js