I am trying to use Uppy with React Native. The documentation seems focused on React with HTML elements. I adopted the code to use React Native components, but an exception is thrown about this5 not being an object when calling updateOnlineStatus. Is there something different that needs to be done for React Native? Are there any examples for using Uppy with React Native?
Hi, thanks for your interest in Uppy! React Native is on our roadmap, but we haven’t gotten around to it yet. Would be amazing if you could show us some code samples or a repo of how you are using Uppy with React Native.
Regarding the error you are describing, I believe its about this code here: https://github.com/transloadit/uppy/blob/bbe308327648a7a6cce2ec1832f7f1ca7ec48285/src/core/Core.js#L745-L749 I guess we need to bind the actions method in constructor, because it’s accessing this, will try that.
If it is not supported yet, you should remove "(Native)" from the Design Goals section of uppy.io, and other places where it is mentioned. Based on other items in that list, it doesn't imply that it's a work in progress.
I don't have code of how I am using it yet, because I haven't been able to use it, because of the error. I just took your example for React, and changed the components to see how I could integrate it.
I think “Design Goals” imply that these are goals, and not features. But thanks for your feedback on that it might be confusing 👍
Would be helpful to know where is updateOnlineStatus being called from, it should be visible in the error stack trace.
01-04 16:29:48.480 14985 16146 W ReactNativeJS: Possible Unhandled Promise Rejection (id: 0):
01-04 16:29:48.480 14985 16146 W ReactNativeJS: TypeError: undefined is not a function (evaluating 'window.addEventListener('online', function () {
01-04 16:29:48.480 14985 16146 W ReactNativeJS: return _this5.updateOnlineStatus();
01-04 16:29:48.480 14985 16146 W ReactNativeJS: })')
All that is given for the stacktrace is
Promise.js:35
rejection-tracking.js:72
JSTimers.js:223
JSTimers.js:143
JSTimers.js:372
MessageQueue.js:266
MessageQueue.js:103
MessageQueue.js:231
MessageQueue.js:102
It doesn't provide anything more than that that I can see. I've attached the file for the screen that I tried Uppy on. Like I said, it's basically just the React example from your page, but I changed the html elements to react components.
Hi, is there any news about React Native support ?
Yes :) The news is that we are working hard to get 1.0 out the door, and that after Lerna.js (the current major issue we're hammering down hard on), React Native is next on our list of goals for that 👌
We’ve released basic React Native example https://github.com/transloadit/uppy/tree/master/examples/react-example and documentation: https://uppy.io/docs/react/native/, please check it out.
Most helpful comment
Yes :) The news is that we are working hard to get 1.0 out the door, and that after Lerna.js (the current major issue we're hammering down hard on), React Native is next on our list of goals for that 👌