Browse Source

Add ES5 require instruction to README.md

wkh237 8 years ago
parent
commit
4aa243c979
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      README.md

+ 13
- 0
README.md View File

113
 
113
 
114
 ## Recipes
114
 ## Recipes
115
 
115
 
116
+ES6
117
+
118
+The module uses ES6 style export statement, simply use `import` to load the module.
119
+
116
 ```js
120
 ```js
117
 import RNFetchBlob from 'react-native-fetch-blob'
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
 #### Download example : Fetch files that needs authorization token
132
 #### Download example : Fetch files that needs authorization token
120
 
133
 
121
 ```js
134
 ```js