You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React-native has a require function, but it is not the same as that in node.js. One critical difference is that it does not support dynamic requires, and does not obey the try/catch block. All requires are done up-front upon static analysis so that the assets can all be packaged into a bundle.
At any rate, in my React-Native app, I do not use jQuery. I tried to use jquery-deparam, but with no luck. React-Native fails to bundle, because it cannot require(jquery).
Do you think it would be possible to make the jQuery dependency injection more explicit? Perhaps with something like:
importaddDeparamfrom'jquery-deparam';importjQueryfrom'jquery';const$=addDeparam(jQuery);// Adds `deparam` method to jQueryconstdeparam=addDeparam();// define `deparam` function to use standalone
The text was updated successfully, but these errors were encountered:
hm, I would imagine this problem would exist for other users of UMD and react-native. Basically, it your environment goes into the node js case, when it shouldn't.
React-native has a
require
function, but it is not the same as that in node.js. One critical difference is that it does not support dynamic requires, and does not obey the try/catch block. All requires are done up-front upon static analysis so that the assets can all be packaged into a bundle.At any rate, in my React-Native app, I do not use jQuery. I tried to use
jquery-deparam
, but with no luck. React-Native fails to bundle, because it cannotrequire(jquery)
.Do you think it would be possible to make the jQuery dependency injection more explicit? Perhaps with something like:
The text was updated successfully, but these errors were encountered: