File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1097,6 +1097,8 @@ Todos
1097
1097
1098
1098
- [ ] make code editor plugin/package/extension that adds GraphQL syntax highlighting for ` useQuery` and ` useMutation` 😊
1099
1099
1100
+ - [ ] add React Native test suite
1101
+
1100
1102
[1]: https://github.com/ava/use-http/issues/new?title=[Feature%20Request]%20YOUR_FEATURE_NAME
1101
1103
[2]: https://github.com/ava/use-http/issues/93#issuecomment-600896722
1102
1104
[3]: https://github.com/ava/use-http/raw/master/public/dog.png
Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ export default async function doFetchArgs<TData = any>(
37
37
const url = `${ initialURL } ${ path } ${ route } `
38
38
39
39
const body = ( ( ) : BodyInit | null => {
40
- if ( isBodyObject ( routeOrBody ) ) return JSON . stringify ( routeOrBody )
40
+ // FormData instanceof check should go first, because React Native's FormData implementation
41
+ // is indistinguishable from plain object when using isBodyObject check
41
42
if ( routeOrBody instanceof FormData ) return routeOrBody
43
+ if ( isBodyObject ( routeOrBody ) ) return JSON . stringify ( routeOrBody )
42
44
if (
43
45
! isServer &&
44
46
( ( bodyAs2ndParam as any ) instanceof FormData ||
You can’t perform that action at this time.
0 commit comments