Skip to content

Adding custom fonts in react native 60+ #25852

Closed
@baterdene-dev

Description

@baterdene-dev

After react native 60 adding custom fonts have changed. Follow this short tutorial to simply add custom fonts in your app.
React Native CLI can be configured by creating a react-native.config.js at the root of the project. Depending on the type of a package, the set of valid properties is different. To add custom fonts we only need to add one line of code: assets: [‘./assets/fonts/’]
1_ezOw7B_Q4C5fUsAA9aKXGQ

Then add your fonts in ./assets/fonts/ directory

1_9QW7IHM1BEQckxUNL5r1oA

And use like this: fontFamily: ‘Roboto-Regular’
Just that simple we have custom fonts in our react native app :)
If you like the article, don’t forget to clap and share it :)

Via Sergo Kupreishvili

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds: Issue TemplateThis issue does not make use of the Issue Template, and may be missing necessary information.Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions