简体   繁体   English

任何人都可以在打字稿中解释 <->

[英]can anyone explain <-> in typescript

new to typescript can anyone explain what is the meaning of this sign <->?打字稿新手谁能解释这个符号<->的含义是什么? Just to confrim, ProductList is actually a function?只是为了确认,ProductList 实际上是一个函数? in the following code.在下面的代码中。

 export const ProductList: React.FC<-> = ({ displayLoader, hasNextPage, notFound, onLoadMore, products, totalCount, }) => { const hasProducts = !!totalCount; return ( <div className="products-list"> <div className="products-list__products container"> {hasProducts ? ( <> <div className="products-list__products__grid"> {products.map(product => ( <Link to={generateProductUrl(product.id, product.name)} key={product.id} > <ProductListItem product={product} /> </Link> ))} </div> <div className="products-list__products__load-more"> {displayLoader ? ( <Loader /> ) : ( hasNextPage && ( <Button secondary onClick={onLoadMore}> Load more products </Button> ) )} </div> </> ) : ( <div className="products-list__products-not-found">{notFound}</div> )} </div> </div> ); };

Please advice.请指教。 Thank you so much.非常感谢。

There should be an interface that will describe a shape of your props object instead of - .应该有一个interface来描述道具对象的形状,而不是- Should look something like this React.FC<IProductListProps> .应该看起来像这样React.FC<IProductListProps> You might get that mistake while copy-pasting.您可能会在复制粘贴时遇到该错误。 There is no such operator like this <-> in TypeScript TypeScript 中没有这样的运算符<->

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

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