簡體   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