Sharing Custom fonts between React Native + Expo and React Native Web

Yannick S
1 min readFeb 22, 2018

Hi Marty Cortez!

I did this setup because I wanted to explore this solution, but I have not built anything with it so far.

However, I have just started a project this week where I can use this setup, and the designs has custom fonts, so I’ll have deal with this problem really soon :)

From the top of my head, I’d say that maybe you can use Expo font loader in the root component of the native app (App.js file at the root of the project) and load the font for web app in the src/index.css file so that create-react-app can pick it up, like this :

@font-face {
font-family: 'MYFONT'; // the id used in Expo font loader
src: url(./assets/fonts/my-custom-font.ttf) format('truetype');
font-weight: normal;
font-style: normal;
}

--

--