Closed ychw closed 8 years ago
@ychw, I'm sorry but having never used (or even played with) React Native, I'm not sure that I can help you. Based on that error though it would appear that it does not run in a browser environment though, which would explain why document
is missing.
Perhaps this is another reason why #53 would be useful, as we could have a separate module for other environments such as React Native (if possible). What I could do to allow for people to do this themselves in the meantime is allow them to specify their own ElementService
implementation. Currently, QRious.use
cannot be called twice, meaning the "element" service cannot be swapped out as this is called per bundle (i.e. Browser, Node.js).
Due to the nature of React Native, I believe a separate module would be best to support this, however, it could fall under this repo if we do move to multi-module.
Same problem. Why this library needs document
or the browser/environment in order to work?
I tried line bellow in my react native project:
and got following error:
2016-08-08 01:03:26.975 [error][tid:com.facebook.react.JavaScript] Can't find variable: document 2016-08-08 01:03:26.991 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Can't find variable: document