I have read several posts about issues that people are having with React Native and the require()
function when trying to require a dynamic resource such as:
Dynamic (fails):
urlName = "sampleData.json";data = require('../'+ urlName);
vs. Static (succeeds):
data = require('../sampleData.json');
I have read on some threads that this is a bug in React Native and in others that this is a feature.
Is there a new way to require a dynamic resource within a function?
Related Posts (all fairly old in React time):