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

Support for react native functional components #217

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

LucasBourgeois
Copy link
Contributor

Hello maintainers.

Why this PR :
Ive many SVG's in a directory, in React Native, assets are loaded at buildTime.
So you must load all of them at the startup to be able to import them and add a babel transformer to make them as RN components.
The real issue with that is that it's not possible to do dynamic imports.
So a font is the main solution.

I did everything to not being dependent of an external React Native package.
Ive tested this implementation on my own project with success.

It was a little bit challenging because of those particularities:

  • unicode in this repo is not unicode but an Html Entity
  • encodedChar is not a unicode
  • Saving an html entity in a variable in RN requires to be a string and it will not be interpreted as an Html entity.
  • We can't (from my knownledge) generates multiple components because we can't dynamic imports components from a variable string...

So here is a (among unknown others) implementation of your package for ReactNative.

I would love to see this merged after all your reviews.
Im sure that it'll help many ppl.

Feel free to give me your feedback.

@jaywcjlove jaywcjlove merged commit f38a936 into jaywcjlove:master Dec 22, 2023
github-actions bot pushed a commit that referenced this pull request Dec 22, 2023
jaywcjlove added a commit that referenced this pull request Dec 22, 2023
@jaywcjlove
Copy link
Owner

@LucasBourgeois Upgrade v4.1.0

github-actions bot pushed a commit that referenced this pull request Dec 22, 2023
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