How to add fonts to create-react-app based projects?

前端 未结 7 1770
长情又很酷
长情又很酷 2020-11-29 15:19

I\'m using create-react-app and prefer not to eject.

It\'s not clear where fonts imported via @font-face and loaded locally should go.

Namely,

7条回答
  •  -上瘾入骨i
    2020-11-29 15:51

    Local fonts linking to your react js may be a failure. So, I prefer to use online css file from google to link fonts. Refer the following code,

    
    

    or

    
    

提交回复
热议问题