Reputation: 330
window
, so currently, it throws an error on import when the code gets interpretedI appreciate your help!
Upvotes: 4
Views: 795
Reputation: 330
In my case I needed to write a custom transformer.
const babelTransformer = require('metro-react-native-babel-transformer');
module.exports.transform = ({ src, filename, options }) => {
return babelTransformer.transform({
src: `let code = ${JSON.stringify(src)}; export default code;`,
filename,
options,
});
};
Upvotes: 7