Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo 50 Solution #344

Closed
akhockey21 opened this issue Mar 12, 2024 · 0 comments
Closed

Expo 50 Solution #344

akhockey21 opened this issue Mar 12, 2024 · 0 comments

Comments

@akhockey21
Copy link

I'm on a tight timeline and can't open a PR at the moment for the Readme but for expo 50 I have a solution based off their documentation.

  1. Un-do any changes you did to the metro.config file as a result of this package.
  2. Add a new root file metro.transformer.js
  3. Paste the following and you're done.
const upstreamTransformer = require("@expo/metro-config/babel-transformer");
const svgTransformer = require("react-native-svg-transformer");

module.exports.transform = async ({ src, filename, options }) => {
  // Use react-native-svg-transformer for SVG files
  if (filename.endsWith(".svg")) {
    return svgTransformer.transform({ src, filename, options });
  }
  // Pass the source through the upstream Expo transformer for other files
  return upstreamTransformer.transform({ src, filename, options });
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant