This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a little code snippet I found useful for adding custom fonts to your React Native / Expo project. | |
// The essential idea is that we map fontWeight to fontFamily via a simple function and some TypeScript magic. We can also make it faster by wrapping the function in a useMemo hook | |
// Here is the mappings of fontWeight to fontFamily for your custom font | |
export const Poppins = { | |
"100": "Poppins_100Thin", | |
"200": "Poppins_200ExtraLight", | |
"300": "Poppins_300Light", | |
"400": "Poppins_400Regular", |