繁体   English   中英

与 typescript 项目反应的国家标志

[英]react country flag in react with typescript project

Hey I am recently working with react and typescript together and I wanted to have some country logos, I installed this package which seems to be the most popular one for reactjs, the package called react country flag, and I cannot use it maybe with ts? 是这样吗? 我的错误是下图中的错误。

在此处输入图像描述

package 不附带 typescript 类型,请在终端中执行此操作。 这将尝试下载该 package 的类型(如果存在)

npm i --save-dev @types/react-country-flag

如果它仍然不存在,请添加

//@ts-ignore 在导入行上方,像这样:

//@ts-ignore
import ReactCountryFlag from "react-country-flag"

这将忽略您遇到的错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM