-
Notifications
You must be signed in to change notification settings - Fork 8
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
Advantage over directly using it #8
Comments
Please refer rohanray/next-fonts#34 |
Makes sense :) |
Hi @rohanray , I found out that this package (alongside with next-images) is the best way to go if you intend to use react-native-web on nextjs without adding expo to your project. This is because (at least in my case) a broadly used library for RN (react-native-vector-icons) which is the peer dependency of several UI libraries requires you to import their .ttf files to your next Head component to decalre the font-icon used by the UI components. Also if you are using Typescript you will need to add type definitions for your font files on your next-env.d.ts file like this: ./path/to/my/types/next-fonts.d.ts declare module "*.ttf" {
const value: string;
export = value;
} next-env.d.ts (add the following line)
My previous workaround was to copy the file from node_modules to my public folder and add that script to package.json posinstall and before run dev and build, which seemed to me kind of hacky. If I knew this earlier it would have saved me a lot of time |
I can't understand the advantage of this package over directly using what Next JS offers. I mean I can do it like the following:
_document.tsx
_app.tsx
index.tsx
So what does this package offers differently?
The text was updated successfully, but these errors were encountered: