Skip to content

docs: add note about transformers like react-native-svg-transformer #362

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

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

Armster15
Copy link
Contributor

PR Description

react-native-svg-transformer is a popular transformer that plenty of people in the RN ecosystem use to import SVGs as React components. This transformer however, breaks SVG usage in this library.

This is not the fault of this library, rather more so on the transformer as it's modifying the default behavior of React Native's (more specifically Metro's) asset handling.

However, as this approach is quite popular, it makes sense adding a note in the docs about it. There's two parts to the warning: first, informing the end user that such transformers will break this functionality. I also added an example of how to resolve this with react-native-svg-transformer specifically as it's quite a popular lib. react-native-svg-transformer unfortunately overrides the svg extension specifically and does not give you an option to change the extension it's overriding (so no svg?react for example 😞), so my proposed solution uses another extension that resolves the SVG to Metro's standard resolution of SVGs and uses that in the code for the tabBarIcon.

Existing GitHub issue showing people struggling with this: #143 (comment)

Cheers, and thanks for this amazing library!

How to test?

N/A

Screenshots

N/A

Copy link

changeset-bot bot commented Jun 13, 2025

⚠️ No Changeset found

Latest commit: f1ce370

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Collaborator

@okwasniewski okwasniewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

@okwasniewski okwasniewski merged commit b8941f0 into callstackincubator:main Jun 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants