apollo-upload-network-interface icon indicating copy to clipboard operation
apollo-upload-network-interface copied to clipboard

Make it work with React Native

Open HriBB opened this issue 8 years ago • 4 comments

As @guilhermedecampo said, this does not work with RN, because it relies on FileList check, which is not available on RN.

You guys have a suggestion to make it easy/seamless using react-native?

Since we just create an object for the file-upload the check logic does not fit because it relies on FileList / File instanceof as you can see here https://github.com/HriBB/apollo-upload-network-interface/blob/master/src/UploadNetworkInterface.js#L21 and here https://github.com/HriBB/apollo-upload-network-interface/blob/master/src/UploadNetworkInterface.js#L47.

Thanks!

I don't use RN yet, so I have absolutely no idea on how to support this. @guilhermedecampo any ideas?

HriBB avatar Dec 08 '16 12:12 HriBB

This is the discussion @HriBB is referring to.

sandervanhooft avatar Dec 08 '16 15:12 sandervanhooft

@sandervanhooft @HriBB we should probably implement some sort of "adapter" construct for browser vs native that abstracts away the file input type and presents a unified object for transport over Form data.

thebigredgeek avatar Dec 08 '16 22:12 thebigredgeek

@thebigredgeek Seems ok. You suggest to do this in 1 repo, or multiple (i.e. using lerna, as @HriBB suggested)?

sandervanhooft avatar Dec 08 '16 22:12 sandervanhooft

Guys writing a snippet of my thoughts here. Get in touch soon.

guilhermedecampo avatar Dec 09 '16 19:12 guilhermedecampo