I'm importing a library into a ReactNative project that uses document
roughly 50 times. Because ReactNative, doesn't use a document
, I will have to rewrite these lines in order for it to work in a ReactNative environment. The question is..
Is it possible to create a shim so that the original library is fully intact?
I would have to rewrite lines like document.body
, document.createElement
and document.appendElement
. I guess document.body
could just be my root container class, and the other two methods are self explanatory.
Because I've never seen anything like this before, I'm only guessing. Would be possible to import the library, and then bind document
as a ReactNative component
so that the component replaces the document in all of its mentions?