Skip to content

Commit 4d0c29a

Browse files
authored
Merge pull request #135 from SimenB/patch-1
Add tips for React Native gotchas.
2 parents 33b440c + 94ac208 commit 4d0c29a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# apollo-upload-client changelog
22

3+
## Next
4+
5+
### Patch
6+
7+
- Add tips for React Native gotchas, via [#135](https://github.com/jaydenseric/apollo-upload-client/pull/135).
8+
39
## 10.0.0
410

511
### Major

readme.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,15 @@ GraphQL request `fetch` options.
211211
212212
A React Native [`File`](https://developer.mozilla.org/docs/web/api/file) substitute.
213213
214+
Be aware that inspecting network requests with Chrome dev tools interferes with the React Native `FormData` implementation, causing network errors.
215+
214216
**Type:** [Object](https://mdn.io/object)
215217
216-
| Property | Type | Description |
217-
| :------- | :------------------------------- | :----------------- |
218-
| `uri` | [String](https://mdn.io/string) | Filesystem path. |
219-
| `name` | [String](https://mdn.io/string)? | File name. |
220-
| `type` | [String](https://mdn.io/string)? | File content type. |
218+
| Property | Type | Description |
219+
| :------- | :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
220+
| `uri` | [String](https://mdn.io/string) | Filesystem path. |
221+
| `name` | [String](https://mdn.io/string)? | File name. |
222+
| `type` | [String](https://mdn.io/string)? | File content type. Some environments (particularly Android) require a valid MIME type; Expo `ImageResult.type` is unreliable as it can be just `image`. |
221223
222224
#### See
223225

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ const { extractFiles, ReactNativeFile } = require('extract-files')
1212
/**
1313
* A React Native [`File`](https://developer.mozilla.org/docs/web/api/file)
1414
* substitute.
15+
*
16+
* Be aware that inspecting network requests with Chrome dev tools interferes
17+
* with the React Native `FormData` implementation, causing network errors.
1518
* @kind typedef
1619
* @name ReactNativeFileSubstitute
1720
* @type {Object}
1821
* @see [`extract-files` docs](https://github.com/jaydenseric/extract-files#type-reactnativefilesubstitute).
1922
* @see [React Native `FormData` polyfill source](https://github.com/facebook/react-native/blob/v0.45.1/Libraries/Network/FormData.js#L34).
2023
* @prop {String} uri Filesystem path.
2124
* @prop {String} [name] File name.
22-
* @prop {String} [type] File content type.
25+
* @prop {String} [type] File content type. Some environments (particularly Android) require a valid MIME type; Expo `ImageResult.type` is unreliable as it can be just `image`.
2326
* @example <caption>A camera roll file.</caption>
2427
* ```js
2528
* {

0 commit comments

Comments
 (0)