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

Document Asset Handling #29

Open
darthtrevino opened this issue May 18, 2018 · 1 comment
Open

Document Asset Handling #29

darthtrevino opened this issue May 18, 2018 · 1 comment

Comments

@darthtrevino
Copy link

It looks like the way to use custom fonts is to add a link in the index.html. It would be nice if there were a mechanism to link and load them as first-class resources like you can on iOS and Android. I'm not sure how other asset types are handled here.

@vincentriemer
Copy link
Owner

When I think about how fonts are loaded in iOS and Android, it's essentially leveraging a configuration option provided by the platform itself, and in the case of the web adding those link tags to the html file is the closest equivalent.

I'm all for a more first-class way to support font loading but unfortunately that isn't really a part of React Native's core and in the early stages of this project I want to focus most on supporting the entirely of the RN core before we move on to creating builtin, web-specific features.

In most cases, if you're itching to get a more streamlined experience you can still implement your own native module which provides that platform specific behavior. For example, like you I wanted to streamline font loading for the demos I was building so I wrote a small native module to allow for loading them from the "react thread": https://gist.github.com/vincentriemer/b8e5e97a92a44638a118016801d378cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants